running ingest throws attribute error module 'chromadb' has no attribute 'PersistentClient'

```
(privategpt-py3.11) (base) ➜  privateGPT git:(main) ✗ python ingest.py
Traceback (most recent call last):
  File "/Volumes/Projects/privateGPT/ingest.py", line 169, in <module>
    main()
  File "/Volumes/Projects/privateGPT/ingest.py", line 146, in main
    chroma_client = chromadb.PersistentClient(settings=CHROMA_SETTINGS , path=persist_directory)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'chromadb' has no attribute 'PersistentClient'

```

.env file:

```
PERSIST_DIRECTORY=db
MODEL_TYPE=GPT4All
MODEL_PATH=models/ggml-gpt4all-j-v1.3-groovy.bin
EMBEDDINGS_MODEL_NAME=all-MiniLM-L6-v2
MODEL_N_CTX=1000
MODEL_N_BATCH=8
TARGET_SOURCE_CHUNKS=4
```

**Environment (please complete the following information):**
 - OS / hardware: macOS 13.5.1
 - Python version 3.11.5

any idea what's wrong here or how to solve it?


`utils.text.reduce_message_length` Not reducing text length

**Bug description**
I come across this issue.
```python
  File "/Users/azure/Documents/Workspace/Datasci/lib/python3.10/site-packages/metagpt/utils/text.py", line 31, in reduce_message_length
    raise RuntimeError("fail to reduce message length")
RuntimeError: fail to reduce message length
```

**Bug solved method**
Digging into the code, I assume `utils.text.reduce_message_length()` only check if the token is short enough.
If it's too long, it simply raise exception, instead of shorten it.
Following it the code in `utils.text.reduce_message_length()`
```python
def reduce_message_length(
    msgs: Generator[str, None, None],
    model_name: str,
    system_text: str,
    reserved: int = 0,
) -> str:
    max_token = TOKEN_MAX.get(model_name, 2048) - count_string_tokens(system_text, model_name) - reserved
    for msg in msgs:
        if count_string_tokens(msg, model_name) < max_token or model_name not in TOKEN_MAX:
            return msg

    raise RuntimeError("fail to reduce message length")
```

- LLM type and model name:
- System version:MetaGPT 0.7.4
- Python version: Python 3.10.13

Is it a feature that is not implemented yet, or I can try to create a PR to fix it


Toward a consistent API for NearestNeighbors & co

### Estimators relying on `NearestNeighbors` (NN), and their related params:
`params = (algorithm, leaf_size, metric, p, metric_params, n_jobs)`

**sklearn.neighbors:**
- `NearestNeighbors(n_neighbors, radius, *params)`
- `KNeighborsClassifier(n_neighbors, *params)`
- `KNeighborsRegressor(n_neighbors, *params)`
- `RadiusNeighborsClassifier(radius, *params)`
- `RadiusNeighborsRegressor(radius, *params)`
- `LocalOutlierFactor(n_neighbors, *params)`
- ~`KernelDensity(algorithm, metric, leaf_size, metric_params)`

**sklearn.manifold:**
- `TSNE(method="barnes_hut", metric)`
- `Isomap(n_neighbors, neighbors_algorithm, n_jobs)`
- `LocallyLinearEmbedding(n_neighbors, neighbors_algorithm, n_jobs)`
- `SpectralEmbedding(affinity='nearest_neighbors', n_neighbors, n_jobs)`

**sklearn.cluster:**
- `SpectralClustering(affinity='nearest_neighbors', n_neighbors, n_jobs)`
- `DBSCAN(eps, *params)`

### How do they call `NearestNeighbors` ?
- Inherit from `NeighborsBase._fit`: NearestNeighbors, KNeighborsClassifier, KNeighborsRegressor, RadiusNeighborsClassifier, RadiusNeighborsRegressor, LocalOutlierFactor
- Call `BallTree/KDTree(X)`: KernelDensity
- Call `kneighbors_graph(X)`: SpectralClustering, SpectralEmbedding
- Call `NearestNeighbors().fit(X)`: TSNE, DBSCAN, Isomap, kneighbors_graph

### Do they handle other form of input X?
- Handle precomputed distances matrix, with (metric/affinity='precomputed'): TSNE, DBSCAN, SpectralEmbedding, SpectralClustering
- Handle `KNeighborsMixin` object: kneighbors_graph
- Handle `NeighborsBase` object: all estimators inheriting NeighborsBase + UnsupervisedMixin
- Handle `BallTree/KDTree` object: all estimators inheriting NeighborsBase + SupervisedFloatMixin/SupervisedIntegerMixin
___
### Issues:
1. We don't have all NN parameters in all classes (e.g. `n_jobs` in TSNE).
2. We can't give a custom NN estimators to these classes. (PR #3922 #8999)
3. The handle of input X as a `NearestNeighbors/BallTree/KDTree` object is not consistent, and not well documented. Sometimes it is documented but does not work (e.g. Isomap), or not well documented but it does work (e.g. LocalOutlierFactor). Most classes almost handle it since `NearestNeighbors().fit(NearestNeighbors().fit(X))` works, but a call to `check_array(X)` prevents it (e.g. Isomap, DBSCAN, SpectralEmbedding, SpectralClustering, LocallyLinearEmbedding, TSNE).
4. The handle of X as a precomputed distances matrix is not consistent, and sometimes does not work with sparse matrices (as given by `kneighbors_graph`) (e.g. TSNE #9691).

### Proposed solutions:

A. We could generalize the use of precomputed distances matrix, and use pipelines to chain `NearestNeighbors` with other estimators. Yet it might not be possible/efficient for some estimators. I this case one would have to adapt the estimators to allow for the following: `Estimator(neighbors='precomputed').fit(distance_matrix, y)`

B. We could improve the checking of X to enable more widely having X as a `NearestNeighbors/BallTree/KDTree` fitted object. The changes would be probably limited, however, this solution is not pipeline-friendly.

C. To be pipeline-friendly, a custom `NearestNeighbors` object could be passed in the params, unfitted. We could then put all NN-related parameters in this estimator parameter, and allow custom estimators with a clear API. This is essentially what is proposed in #8999.


Implement PEP 688: Making the buffer protocol accessible in Python

PEP-688 has just been accepted. I will use this issue to track its implementation in CPython.

<!-- gh-linked-prs -->
### Linked PRs
* gh-102521
* gh-102571
* gh-104174
* gh-104281
* gh-104288
* gh-104317
<!-- /gh-linked-prs -->

{'base_commit': '55d50d147c953fab37b273bca9ab010f40e067d3', 'files': [{'path': 'Include/internal/pycore_global_objects_fini_generated.h', 'status': 'modified', 'Loc': {"(None, '_PyStaticObjects_CheckRefcnt', 24)": {'add': [595, 694, 1124]}}}, {'path': 'Include/internal/pycore_global_strings.h', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [83, 182, 612]}}}, {'path': 'Include/internal/pycore_runtime_init_generated.h', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [589, 688, 1118]}}}, {'path': 'Include/internal/pycore_typeobject.h', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [140]}}}, {'path': 'Include/internal/pycore_unicodeobject_generated.h', 'status': 'modified', 'Loc': {"(None, '_PyUnicode_InitStaticStrings', 12)": {'add': [98, 395, 1685]}}}, {'path': 'Include/pybuffer.h', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [107]}}}, {'path': 'Lib/_collections_abc.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [441], 'mod': [52]}}}, {'path': 'Lib/inspect.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [45, 3314]}}}, {'path': 'Lib/test/test_buffer.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [19, 4440]}}}, {'path': 'Lib/test/test_collections.py', 'status': 'modified', 'Loc': {"('TestCollectionABCs', None, 1416)": {'add': [1951]}, '(None, None, None)': {'mod': [28]}}}, {'path': 'Lib/test/test_doctest.py', 'status': 'modified', 'Loc': {"('test_DocTestFinder', 'non_Python_modules', 700)": {'mod': [710]}}}, {'path': 'Modules/Setup.stdlib.in', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [172]}}}, {'path': 'Modules/_testcapi/parts.h', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [40]}}}, {'path': 'Modules/_testcapimodule.c', 'status': 'modified', 'Loc': {"(None, 'PyInit__testcapi', 4162)": {'add': [4312]}}}, {'path': 'Objects/clinic/memoryobject.c.h', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [64], 'mod': [359]}}}, {'path': 'Objects/memoryobject.c', 'status': 'modified', 'Loc': {'(None, None, 783)': {'add': [807], 'mod': [795]}, '(None, None, None)': {'add': [970, 3186], 'mod': [780]}, "(None, '_PyManagedBuffer_FromObject', 88)": {'mod': [88]}, '(None, None, 87)': {'mod': [96]}, "(None, 'PyMemoryView_FromObject', 784)": {'mod': [784]}, '(None, None, 838)': {'mod': [854]}}}, {'path': 'Objects/object.c', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [16, 2075]}}}, {'path': 'Objects/typeobject.c', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [8, 8061, 8897, 8964, 8983, 9064]}, '(None, None, 9203)': {'mod': [9211, 9212]}}}, {'path': 'PCbuild/_testcapi.vcxproj', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [112]}}}, {'path': 'PCbuild/_testcapi.vcxproj.filters', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [62]}}}, {'path': 'Tools/build/generate_global_objects.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [123]}}}, {'path': 'Tools/c-analyzer/cpython/globals-to-fix.tsv', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [88]}}}, {'path': 'Tools/c-analyzer/cpython/ignored.tsv', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [406]}}}]}


Tests broken with Twisted 22.1.0

`ImportError: cannot import name 'PayloadResource' from 'twisted.web.test.test_webclient'`

`ImportError: cannot import name 'ForeverTakingResource' from 'twisted.web.test.test_webclient'`


The exported label txt seems have problem

Hi, @glenn-jocher  i manage to use `python detect.py --save-txt` to semi-auto label images, but when i set `Open Dir` and `Change Save Dir` in [labelImg](https://github.com/tzutalin/labelImg/releases/tag/v1.8.1)，the labelImg can not display the exported bbox, and its command line window appears error:
```
Traceback (most recent call last):
  File "<string>", line 1268, in openNextImg
  File "<string>", line 1035, in loadFile
  File "<string>", line 1427, in loadYOLOTXTByFilename
  File "Z:\home\darrenl\tmp\labelImg\build-tools\build\labelImg\out00-PYZ.pyz\libs.yolo_io", line 112, in __init__
  File "Z:\home\darrenl\tmp\labelImg\build-tools\build\labelImg\out00-PYZ.pyz\libs.yolo_io", line 142, in parseYoloFormat
ValueError: too many values to unpack
```
If i set `Change Save Dir`  to another empty folder, it will not occur error, so i doubt it is the problem of exported label txt, could you have a try ?


Session pickling support is broken and tests for it are removed

The commit 42b029552190f6639642d0f62d27abcd1ceed51e removes the `__attrs__` attribute of the `Session` class, which is used in the pickle protocol's `__getstate__` method.

The tests that are testing this functionality (functions `test_session_pickling` and `test_unpickled_session_requests` in the once present `tests/test_requests.py`) are also removed.

The commit messages don't seem to indicate any reason for this, and I can't find anything searching in the issues.

If it is intended that pickling of Session objects not be supported, could you give the reason? And may be the `__getstate__` and `__setstate__` methods should be removed too, as they might send a wrong message.

If this is unintended (which is what I think is the case), I can work on a pull request to fix this. Please confirm.

Thank you.


Massage about Pinecone initializing

### Duplicates

- [X] I have searched the existing issues

### Summary 💡

Add a message like: "Connecting Pinecone. This may take some time..."

### Examples 🌈

_No response_

### Motivation 🔦

At this point, if the Pinecone index setup takes a noticeable amount of time, the console just stops. It is necessary to notify the user that the index is being configured now and this may take some time.

{'base_commit': '34261a15835390c5c464cef88c4a42b52a88b739', 'files': [{'path': 'autogpt/memory/pinecone.py', 'status': 'modified', 'Loc': {"('PineconeMemory', '__init__', 10)": {'add': [40]}}}]}


<!--
Before submitting a bug, please make sure the issue hasn't been already
addressed by searching through the past issues.
-->

#### Describe the bug

When I run some preprocessing on my data the line triggering the error is:

```
C:\local_tools\Anaconda3\envs\mother_env\lib\site-packages\sklearn\feature_extraction\_dict_vectorizer.py in _transform(self, X, fitting)
    226                                                indices=indices, values=values)
    227
--> 228                 if feature_name is not None:
    229                     if fitting and feature_name not in vocab:
    230                         vocab[feature_name] = len(feature_names)

UnboundLocalError: local variable 'feature_name' referenced before assignment
```

#### Steps/Code to Reproduce
<!--
Please add a minimal example that we can reproduce the error by running the
code. Be as succinct as possible, do not depend on external data. In short, we
are going to copy-paste your code and we expect to get the same
result as you.

Example:
```python
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
docs = ["Help I have a bug" for i in range(1000)]
vectorizer = CountVectorizer(input=docs, analyzer='word')
lda_features = vectorizer.fit_transform(docs)
lda_model = LatentDirichletAllocation(
    n_topics=10,
    learning_method='online',
    evaluate_every=10,
    n_jobs=4,
)
model = lda_model.fit(lda_features)
```
If the code is too long, feel free to put it in a public gist and link
it in the issue: https://gist.github.com
-->

It involves a bit too much preprocessing to put here but from inspecting the respective source file (see above, sklearn\feature_extraction\_dict_vectorizer.py) I have the strong suspicion that ```feature_name``` can go through all if/elif checks without being assigned anything.

#### Versions
<!--
Please run the following snippet and paste the output below.
For scikit-learn >= 0.20:
import sklearn; sklearn.show_versions()
For scikit-learn < 0.20:
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import sklearn; print("Scikit-Learn", sklearn.__version__)
import imblearn; print("Imbalanced-Learn", imblearn.__version__)
-->

System:
    python: 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]
executable: C:\local_tools\Anaconda3\envs\mother_env\python.exe
   machine: Windows-10-10.0.18362-SP0

Python dependencies:
          pip: 20.3.3
   setuptools: 52.0.0.post20210125
      sklearn: 0.24.1
        numpy: 1.19.2
        scipy: 1.6.0
       Cython: None
       pandas: 1.2.1
   matplotlib: 3.3.4
       joblib: 1.0.1
threadpoolctl: 2.1.0

Built with OpenMP: True

<!-- Thanks for contributing! -->

{'base_commit': '6f7ae911f18fda59669309582706f1aa1f36374d', 'files': [{'path': 'doc/whats_new/v1.0.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [346], 'mod': [343]}}}, {'path': 'sklearn/feature_extraction/_dict_vectorizer.py', 'status': 'modified', 'Loc': {"('DictVectorizer', '_transform', 190)": {'add': [246], 'mod': [229, 230, 231, 232, 233, 234, 235]}}}, {'path': 'sklearn/feature_extraction/tests/test_dict_vectorizer.py', 'status': 'modified', 'Loc': {"(None, 'test_dictvectorizer_dense_sparse_equivalence', 174)": {'add': [211]}}}]}


Deprecate LSHForest

LSHForest should be deprecated and scheduled for removal in 0.21. It should also warn about having bad performance. cc @ogrisel


Multi-GPU training

I've read reports of people succesfully training on multiple GPU'S using the following code:

```
from keras.utils import multi_gpu_model

autoencoder_A = multi_gpu_model( autoencoder_A ,2)
autoencoder_B = multi_gpu_model( autoencoder_B ,2)
```

https://keras.io/utils/#multi_gpu_model

I could add support for this but I can't test it as I only have a single GPU.
Anyobe here with a multi-GPU setup that would like to have a go at this?

{'base_commit': '9438672b1cf80602fc93536670d9601d655377f5', 'files': [{'path': 'scripts/train.py', 'status': 'modified', 'Loc': {"('TrainingProcessor', 'parse_arguments', 25)": {'mod': [75]}}}]}


Internal Refactoring: Towards a Multi-Distribution Setup

Over the next few weeks and months we’re refactoring the code in this repository to move toward a **multi-distribution setup**.

For now this only affects active contributors as well as any developers that depend on code existing in the published container under the path `/opt/code/localstack/localstack`. Most users should not be affected by this change.

## Motivation
This will enable us to define clearer boundaries and allows for easier re-use of individual components.
Some of the previously internal code has already been moved into external open repositories such as [localstack/rolo](https://github.com/localstack/rolo).
Other parts of the codebase will keep living in this repository but under its own distribution.
How we will map this to PyPI items is still being discussed and should become clearer over the next weeks during the initial refactorings.

The code layout is not part of any official API or semver guarantees, nevertheless we still want to use this chance to give you a heads up and some guidance in how to make your existing code compatible with the new structure.

## Detailed instructions

### 1. Moving everything into `localstack-core`

As a first step, the entirety of the localstack module is moved into a `localstack-core` directory with https://github.com/localstack/localstack/pull/10800, which will make up one of the multiple distributions.

In this initial step on our way to a multi-distribution system, only the additional root level of `localstack-core` is introduced and the rest of the directory structure is unchanged.

- If you have an open PR, you can rebase onto master after  https://github.com/localstack/localstack/pull/10800 has been merged.
- After the PR is merged, update your local repository with `git pull`, remove the now empty localstack directory `rm -r localstack`, and run a `make clean install`. You should see an `localstack_core.egg-info` directory in `localstack-core/`
- If you are an active contributor and you're using the PyCharm IDE, you need to adapt your project structure by marking the new `localstack-core` module as a source folder. Otherwise you will encounter errors where it will complain about not being able to find the `localstack` module.
  - ![Untitled (1)](https://github.com/localstack/localstack/assets/620817/e7d9694f-1e2f-49dd-a272-f1e79df7eefb)

- If you want to call code from the `localstack` module, you now need to perform an installation of the project (e.g. with `pip install -e .`). Previously, since `localstack` was a root-level module, python automatically included it in its import path. With a source directory layout there is a more strict boundary now which also helps avoiding unintentional imports. See [here](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/) for more information on the differences between a flat and a src layout.

- The location of test files is unchanged.
- Locally the code moves from `.../localstack/localstack/...`  => `.../localstack/localstack-core/localstack/...`
- In the published container the code moves from `/opt/code/localstack/localstack` => `/opt/code/localstack/localstack-core/localstack`

### ?. Next steps
After the initial move is over the line, additional code will be extracted from `localstack-core` into new distributions such as `localstack-cli`.
This issue will be updated with new information as the project progresses.

{'base_commit': 'b8290ff8013366de16f7dd2ed14d74b56d1fb03b', 'files': [{'path': '.circleci/config.yml', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [137, 405, 468, 469, 559, 560, 561, 562]}}}, {'path': '.dockerignore', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [4]}}}, {'path': '.github/workflows/asf-updates.yml', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [61, 66]}}}, {'path': '.github/workflows/tests-pro-integration.yml', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [294, 301, 337]}}}, {'path': '.github/workflows/tests-s3-image.yml', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [7, 8, 9, 10, 11, 12, 13, 14, 15, 26, 27, 28, 29, 30, 31, 32, 33, 34]}}}, {'path': 'Dockerfile', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [101], 'mod': [179]}}}, {'path': 'Dockerfile.s3', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [6], 'mod': [84]}}}, {'path': 'Makefile', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [239], 'mod': [76, 83, 244]}}}]}


Returning Response and headers causes duplicate headers

<!-- **This issue tracker is a tool to address bugs in Flask itself.
Please use the Pallets Discord or Stack Overflow for general questions
about using Flask or issues not related to Flask.** -->

<!-- If you'd like to report a bug in Flask, fill out the template below. Provide
any extra information that may be useful / related to your problem.
Ideally, create an [MCVE](https://stackoverflow.com/help/mcve), which helps us
understand the problem and helps check that it is not caused by something in
your code. -->

### Expected Behavior

```
from flask import Flask
app = Flask(__name__)
@app.route('/')
def issue():
    return {'test': 'test'}, {'Content-Type': 'test'}
```
Using `curl -v http://127.0.0.1:5000/` to query the view I expect only one `Content-Type` header > `Content-Type: test`

### Actual Behavior

Duplicate headers are returned

```
< Content-Type: application/json
< Content-Type: test
```

### Environment

* Python version: 3.8.2
* Flask version: 1.1.2
* Werkzeug version: 1.0.1

### Context

This issue also effects responses created with make_response when using a dict or jsonify body + the headers argument with a 'Content-Type':

```
from flask import Flask, make_response
app = Flask(__name__)
@app.route('/')
def issue():
    return make_response({'test': 'test'}, {'Content-Type': 'test'})
```

This issue is caused by jsonify adding a 'Content-Type' header then make_response uses `extent` to add the additional headers, thus leading to the duplicate.

Returning a str/bytes body does not have this problem as no 'Content-Type' is added by flask, if one is missing it is added by werkzeug.

The reason I came across this issue is we have older code which does `return json.dumps(data), 200, {'Content-Type': 'application/json+somecustomtype'}` and I assumed based on the flask docs that just returning the data and letting flask do the jsonify would be better.

{'base_commit': '6f2fdc5ac4ad869a21c4c0281d7fa1eb8aa5a689', 'files': [{'path': 'CHANGES.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [30, 31, 32]}}}, {'path': 'src/flask/app.py', 'status': 'modified', 'Loc': {"('Flask', 'make_response', 1935)": {'mod': [2048]}}}, {'path': 'tests/test_basic.py', 'status': 'modified', 'Loc': {"(None, 'from_response_headers', 1118)": {'mod': [1120, 1121]}, "(None, 'test_response_types', 1092)": {'mod': [1158]}}}]}


[Bug]: Unsupported image type in input when using input image

### Checklist

- [ ] The issue has not been resolved by following the [troubleshooting guide](https://github.com/lllyasviel/Fooocus/blob/main/troubleshoot.md)
- [ ] The issue exists on a clean installation of Fooocus
- [ ] The issue exists in the current version of Fooocus
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

Whether I'm using image prompt or inpaint/outpaint, I get the error: Unsupported image type in input.
Normal image generation from text works fine, but using any input image throws this error.
Others have reported the same issue on Reddit, so it's not just me.

### Steps to reproduce the problem

1. Run foocus.
2. Try to use inpaint on any image.

### What should have happened?

Just do the magic...

### What browsers do you use to access Fooocus?

Microsoft Edge

### Where are you running Fooocus?

Cloud (Google Colab)

### What operating system are you using?

Win 11

### Console logs

```Shell
Traceback (most recent call last):
  File "/content/Fooocus/modules/gradio_hijack.py", line 279, in preprocess
    im = processing_utils.decode_base64_to_image(x)
  File "/usr/local/lib/python3.10/dist-packages/gradio/processing_utils.py", line 59, in decode_base64_to_image
    img = Image.open(BytesIO(base64.b64decode(image_encoded)))
  File "/usr/local/lib/python3.10/dist-packages/PIL/Image.py", line 3283, in open
    rawmode = mode
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x782f4810f010>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1429, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1239, in preprocess_data
    processed_input.append(block.preprocess(inputs[i]))
  File "/content/Fooocus/modules/gradio_hijack.py", line 281, in preprocess
    raise Error("Unsupported image type in input")
gradio.exceptions.Error: 'Unsupported image type in input'
```

### Additional information

I noticed gradio was down today, I don't know if this has anything to do with the issue


help me

when i run the install.sh it gives me this error [✘] Installation Failed !!! [✘]
[✔] Loading ...
Hit:1 http://kali.download/kali kali-rolling InRelease
Reading package lists... Done
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-pip

E: Package 'python-pip' has no installation candidate
[✔] Checking directories...
[✔] Installing ...

fatal: could not create work tree dir '/usr/share/doc/hackingtool': Permission denied

[✔] Trying to installing Requirements ...
Requirement already satisfied: lolcat in /usr/local/lib/python3.9/dist-packages (1.4)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
figlet is already the newest version (2.2.5-3+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already satisfied: boxes in /usr/local/lib/python3.9/dist-packages (0.0.0)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
boxes is already the newest version (2.1.1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already satisfied: flask in /usr/local/lib/python3.9/dist-packages (2.0.2)
Requirement already satisfied: click>=7.1.2 in /usr/local/lib/python3.9/dist-packages (from flask) (8.0.3)
Requirement already satisfied: Jinja2>=3.0 in /usr/local/lib/python3.9/dist-packages (from flask) (3.0.3)
Requirement already satisfied: Werkzeug>=2.0 in /usr/local/lib/python3.9/dist-packages (from flask) (2.0.2)
Requirement already satisfied: itsdangerous>=2.0 in /usr/local/lib/python3.9/dist-packages (from flask) (2.0.1)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.9/dist-packages (from Jinja2>=3.0->flask) (2.0.1)
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (2.27.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests) (2.0.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests) (2021.10.8)
[✘] Installation Failed !!! [✘]


弱弱的提问，怎么可以解析前端项目呢

弱弱的提问，怎么可以解析前端项目呢

{'base_commit': '6b5bdbe98a882a726ec9710e5e94baa94d470ad6', 'files': [{'path': 'functional_crazy.py', 'status': 'modified', 'Loc': {"(None, 'get_crazy_functionals', 3)": {'mod': [46]}}}]}


Data type mismatch problem when calling HistGradientBoostingClassifier.predict()

<!--
Before submitting a bug, please make sure the issue hasn't been already
addressed by searching through the past issues.
-->

#### Describe the bug
It looks like HistGradientBoostingClassifier has problems on handling datasets with different data types. It works fine when X is `np.float`. However, when X is of the type `uint8`, HistGradientBoostingClassifier crushes when calling `predict()`.

#### Steps/Code to Reproduce
<!--
Please add a minimal example that we can reproduce the error by running the
code. Be as succinct as possible, do not depend on external data. In short, we
are going to copy-paste your code and we expect to get the same
result as you.

Example:
```python
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
docs = ["Help I have a bug" for i in range(1000)]
vectorizer = CountVectorizer(input=docs, analyzer='word')
lda_features = vectorizer.fit_transform(docs)
lda_model = LatentDirichletAllocation(
    n_topics=10,
    learning_method='online',
    evaluate_every=10,
    n_jobs=4,
)
model = lda_model.fit(lda_features)
```
If the code is too long, feel free to put it in a public gist and link
it in the issue: https://gist.github.com
-->

```
from keras.datasets import mnist
from sklearn.metrics import accuracy_score
from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import HistGradientBoostingClassifier

if __name__ == '__main__':

    (X_train, y_train), (X_test, y_test) = mnist.load_data()
    X_train = X_train.reshape(X_train.shape[0], -1)
    X_test = X_test.reshape(X_test.shape[0], -1)

    model = HistGradientBoostingClassifier(max_iter=100,
                                           loss='categorical_crossentropy',
                                           validation_fraction=None,
                                           random_state=0)

    model.fit(X_train, y_train)
    y_pred = model.predict(X_test)
    acc = accuracy_score(y_test, y_pred)

    print('Testing Acc: {:.4f} %'.format(100.*acc))
```

#### Expected Results
The HistGradientBoostingClassifier successfully returns prediction results.

#### Actual Results
```
  File "FILEPATH", line 21, in <module>
    y_pred = model.predict(X_test)

  File "C:\Software\Anaconda\lib\site-packages\sklearn\ensemble\_hist_gradient_boosting\gradient_boosting.py", line 1114, in predict
    encoded_classes = np.argmax(self.predict_proba(X), axis=1)

  File "C:\Software\Anaconda\lib\site-packages\sklearn\ensemble\_hist_gradient_boosting\gradient_boosting.py", line 1130, in predict_proba
    raw_predictions = self._raw_predict(X)

  File "C:\Software\Anaconda\lib\site-packages\sklearn\ensemble\_hist_gradient_boosting\gradient_boosting.py", line 667, in _raw_predict
    raw_predictions[k, :] += predict(X)

  File "C:\Software\Anaconda\lib\site-packages\sklearn\ensemble\_hist_gradient_boosting\predictor.py", line 47, in predict
    _predict_from_numeric_data(self.nodes, X, out)

  File "sklearn\ensemble\_hist_gradient_boosting\_predictor.pyx", line 26, in sklearn.ensemble._hist_gradient_boosting._predictor._predict_from_numeric_data

ValueError: Buffer dtype mismatch, expected 'const X_DTYPE_C' but got 'unsigned char'
```

#### Versions
<!--
Please run the following snippet and paste the output below.
For scikit-learn >= 0.20:
import sklearn; sklearn.show_versions()
For scikit-learn < 0.20:
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import sklearn; print("Scikit-Learn", sklearn.__version__)
import imblearn; print("Imbalanced-Learn", imblearn.__version__)
-->

cython == 0.29.21
scikit-learn == 0.23.1

<!-- Thanks for contributing! -->

{'base_commit': '2b79665b90bd54fa59701090d5f608a1fc4dd33a', 'files': [{'path': 'doc/whats_new/v0.24.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [213]}}}, {'path': 'sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py', 'status': 'modified', 'Loc': {"('BaseHistGradientBoosting', '_raw_predict', 635)": {'mod': [648, 649, 656]}}}, {'path': 'sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py', 'status': 'modified', 'Loc': {"(None, 'test_staged_predict', 760)": {'add': [796]}}}]}


Fuck alias for fish

`~> fuck` says:

> ```
> Seems like fuck alias isn't configured!
> Please put eval thefuck --alias in your ~/.config/fish/config.fish.
> More details - https://github.com/nvbn/thefuck#manual-installation
> ```

but https://github.com/nvbn/thefuck/wiki/Shell-aliases says:

> Add this function to config.fish:
>
> ``` fish
> eval (thefuck --alias | tr '\n' ';')
> ```

What should I add to my `config.fish`?
- `eval thefuck --alias`

or
- `eval (thefuck --alias | tr '\n' ';')`

{'base_commit': 'fee874cddc1af36344e1cdaedd6d80eb6aea8341', 'files': [{'path': 'thefuck/shells.py', 'status': 'modified', 'Loc': {"('Fish', 'how_to_configure', 201)": {'mod': [202]}}}]}


Add an `ssl.OP_ENABLE_KTLS` option for enabling the use of the kernel TLS

# Feature or enhancement

A new `ssl.OP_ENABLE_KTLS` option for enabling the use of the kernel TLS.

# Pitch

Kernel Transport Layer Security (kTLS) can improve performance of programs using TLS by reducing the number of switches between the user space and the kernel space. kTLS allows using the `sendfile` system call for sending data using TLS. Also, it may offload TLS to network interface controllers.

kTLS is not enabled by default for various reasons which you can find in https://github.com/openssl/openssl/issues/13794. Even if a system supports the feature and OpenSSL was compiled with support for it, Python still has to set an OpenSSL's option `SSL_OP_ENABLE_KTLS` to use it.

In theory, it is possible to enable the kernel TLS in any Python compiled against OpenSSL 3 using this following code. If all other requirements are met, Python should start writing to and reading from a secure socket using the kernel TLS.
```python
import ssl
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.options |= 8  # SSL_OP_ENABLE_KTLS
```

Since Python's `ssl` module defines a few constants similar to `SSL_OP_ENABLE_KTLS`, it should provide an `ssl.OP_ENABLE_KTLS` option.

# Previous discussion

I created https://discuss.python.org/t/sslsocket-sendfile-and-kernel-tls/18886 previously to discuss benefiting from the OpenSSL's [SSL_sendfile](https://www.openssl.org/docs/manmaster/man3/SSL_sendfile.html) function. An option for enabling kTLS is a base for the work.

{'base_commit': '9f1814723f5596115a794a8bec0d053f25dbf32f', 'files': [{'path': 'Doc/library/ssl.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [841]}}}, {'path': 'Modules/_ssl.c', 'status': 'modified', 'Loc': {"(None, 'sslmodule_init_constants', 5725)": {'add': [5883]}}}]}


SQuAD 2.0 metric not supported

Hello.
I'm trying to run the official `run_qa.py` code for SQuAD 2.0.

You have an open TODO here that is causing a bug: https://github.com/huggingface/transformers/blob/master/examples/question-answering/run_qa.py#L436

I would like to know what is the status of this TODO, and if it is going to be updated, or is there a way around it.

This is the current code:

```python
    current_dir = os.path.sep.join(os.path.join(__file__).split(os.path.sep)[:-1])
    metric = load_metric(os.path.join(current_dir, "squad_v2_local") if data_args.version_2_with_negative else "squad")
```

I receive:
```
FileNotFoundError: Couldn't find file locally at .../squad_v2_local/squad_v2_local.py,
```

I've tried to change it to:
```python
metric = load_metric("squad_v2" if data_args.version_2_with_negative else "squad")
```

But this is the stacktrace I receive:
```
Traceback (most recent call last):
  File "/data/users/yonatab/transformers_pip/QA/run_qa_val_more_valueable.py", line 557, in <module>
    main()
  File "/data/users/yonatab/transformers_pip/QA/run_qa_val_more_valueable.py", line 538, in main
    results = trainer.evaluate()
  File "/data/users/yonatab/transformers_pip/QA/trainer_qa.py", line 63, in evaluate
    metrics = self.compute_metrics(eval_preds)
  File "/data/users/yonatab/transformers_pip/QA/run_qa_val_more_valueable.py", line 499, in compute_metrics
    return metric.compute(predictions=p.predictions, references=p.label_ids)
  File "/data/users/yonatab/transformers_pip/trans_pip/lib/python3.6/site-packages/datasets/metric.py", line 398, in compute
    output = self._compute(predictions=predictions, references=references, **kwargs)
  File "/home/ec2-user/.cache/huggingface/modules/datasets_modules/metrics/squad_v2/7529efd518b03f775290694e7b797412cb2253e90b4f843af83cf7434cccb3a8/squad_v2.py", line 108, in _compute
    exact_raw, f1_raw = get_raw_scores(dataset, predictions)
  File "/home/ec2-user/.cache/huggingface/modules/datasets_modules/metrics/squad_v2/7529efd518b03f775290694e7b797412cb2253e90b4f843af83cf7434cccb3a8/evaluate.py", line 111, in get_raw_scores
    gold_answers = [a["text"] for a in qa["answers"] if normalize_answer(a["text"])]
  File "/home/ec2-user/.cache/huggingface/modules/datasets_modules/metrics/squad_v2/7529efd518b03f775290694e7b797412cb2253e90b4f843af83cf7434cccb3a8/evaluate.py", line 111, in <listcomp>
    gold_answers = [a["text"] for a in qa["answers"] if normalize_answer(a["text"])]
TypeError: string indices must be integers
100%|███████████████████████████████████████████| 13/13 [00:05<00:00,  2.51it/s]
```

How can I solve it?

Thanks

{'base_commit': 'fa876aee2adf525b597495c10ad9c96896953dbd', 'files': [{'path': 'examples/question-answering/requirements.txt', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [1]}}}, {'path': 'examples/question-answering/run_qa.py', 'status': 'modified', 'Loc': {"(None, 'main', 159)": {'mod': [436, 437, 438]}}}, {'path': 'examples/question-answering/run_qa_beam_search.py', 'status': 'modified', 'Loc': {"(None, 'main', 158)": {'mod': [475, 476, 477]}}}, {'path': 'examples/question-answering/squad_v2_local/evaluate.py', 'status': 'removed', 'Loc': {}}, {'path': 'examples/question-answering/squad_v2_local/squad_v2_local.py', 'status': 'removed', 'Loc': {}}]}


Blackplanet false positive

Blackplanet is giving false positives. (request from germany)
@Czechball you added this in #81 ; maybe you are able to fix it?


RAG faiss AssertionError

**Bug description**
<!-- Clearly and directly describe the current bug -->
execute this demo
```Python
import asyncio

from metagpt.rag.engines import SimpleEngine
from metagpt.rag.schema import FAISSRetrieverConfig
from metagpt.const import EXAMPLE_DATA_PATH

DOC_PATH = EXAMPLE_DATA_PATH / "rag/travel.txt"

async def main():
    engine = SimpleEngine.from_docs(input_files=[DOC_PATH], retriever_configs=[FAISSRetrieverConfig()])

    answer = await engine.aquery("What does Bob like?")
    print(answer)

if __name__ == "__main__":
    asyncio.run(main())

```
get error
```bash
Traceback (most recent call last):
  File "/home/wanfu/projects/llm/multi_agent_rag/src/simple_custom_object.py", line 26, in <module>
    asyncio.run(main())
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/home/wanfu/projects/llm/multi_agent_rag/src/simple_custom_object.py", line 21, in main
    engine.add_docs([DOC_PATH])
  File "/mnt/data/work/development/projects/llm/MetaGPT/metagpt/rag/engines/simple.py", line 195, in add_docs
    self._save_nodes(nodes)
  File "/mnt/data/work/development/projects/llm/MetaGPT/metagpt/rag/engines/simple.py", line 274, in _save_nodes
    self.retriever.add_nodes(nodes)
  File "/mnt/data/work/development/projects/llm/MetaGPT/metagpt/rag/retrievers/faiss_retriever.py", line 12, in add_nodes
    self._index.insert_nodes(nodes, **kwargs)
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/site-packages/llama_index/core/indices/vector_store/base.py", line 320, in insert_nodes
    self._insert(nodes, **insert_kwargs)
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/site-packages/llama_index/core/indices/vector_store/base.py", line 311, in _insert
    self._add_nodes_to_index(self._index_struct, nodes, **insert_kwargs)
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/site-packages/llama_index/core/indices/vector_store/base.py", line 233, in _add_nodes_to_index
    new_ids = self._vector_store.add(nodes_batch, **insert_kwargs)
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/site-packages/llama_index/vector_stores/faiss/base.py", line 121, in add
    self._faiss_index.add(text_embedding_np)
  File "/home/wanfu/data/miniconda3/envs/metagpt/lib/python3.9/site-packages/faiss/__init__.py", line 214, in replacement_add
    assert d == self.d
AssertionError
```

**Bug solved method**
<!-- If you solved the bug, describe the idea or process to solve the current bug. Of course, you can also paste the URL address of your Pull Request. -->
<!-- If not, provide more auxiliary information to facilitate our further positioning and investigation  -->

**Environment information**
<!-- Environment：System version (like ubuntu 22.04), Python version (conda python 3.7), LLM type and model (OpenAI gpt-4-1106-preview) -->

- LLM type and model name: zhipuai
- Embeddings : fastchat, BAAI/bge-large-zh
- System version: Ubuntu 22.04
- Python version: 3.9.19
- MetaGPT version or branch:

<!-- Dependent packagess：the packages version cause the bug(like `pydantic 1.10.8`), installation method（like `pip install metagpt` or `pip install from source` or `run in docker`） -->

- packages version:
- installation method: pip install from source

**Screenshots or logs**
<!-- Screenshots or logs of the bug can help us understand the problem more quickly -->

{'base_commit': 'f201b2f5f32c2d48eab6632bf103e9b3a92fc999', 'files': [{'path': 'config/config2.example.yaml', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [20]}}}, {'path': 'metagpt/configs/embedding_config.py', 'status': 'modified', 'Loc': {"('EmbeddingConfig', None, 16)": {'add': [22, 27, 34, 43]}}}, {'path': 'metagpt/rag/schema.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [14]}, "('FAISSRetrieverConfig', 'check_dimensions', 45)": {'mod': [47]}}}]}


Reason for the recently added shape restriction in MultiHeadAttention

Hello,

Wondering why is there a restriction on the input shape of `query` and `value` to have a matching final dimension?

This blocks having cross-attention to a source that has a different shape than query, unless adding an extra projection layer. Given that all input tensors (`query`, `key`, `value`) are immediately projected by dense layers inside `MultiHeadAttention`, I don't think any restriction on final dims is necessary.

For reference, the [pytorch doc](https://keras.io/api/layers/attention_layers/multi_head_attention/) for `MultiHeadAttention` explicitly uses 3 distinct variables to describe expected dimensions for the three tensors. The tensorflow implementation does not enforce such restriction as well.

The restriction is enforced here: https://github.com/keras-team/keras/blob/5aa5f88dc200bbf2cd765d5a213c23c58da48e80/keras/src/layers/attention/multi_head_attention.py#L214-L219

And was added as part of the PR #19973 (in response to the issue #19769)

Thanks

{'base_commit': '8f5592bcb61ff48c96560c8923e482db1076b54a', 'files': [{'path': 'keras/src/layers/attention/multi_head_attention.py', 'status': 'modified', 'Loc': {"('MultiHeadAttention', 'build', 199)": {'mod': [214, 215, 216, 217, 218, 219]}, "('MultiHeadAttention', 'compute_output_shape', 598)": {'mod': [607, 608, 609, 610, 611, 612]}}}, {'path': 'keras/src/layers/attention/multi_head_attention_test.py', 'status': 'modified', 'Loc': {"('MultiHeadAttentionTest', None, 17)": {'add': [106], 'mod': [133]}}}]}


python3
support:community
bug
has_pr
affects_2.7
collection
collection:community.general
needs_collection_redirect
bot_closed

"machinectl: invalid option -- 'c'" when using become_method: machinectl

<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Explain the problem briefly below -->
`become_method: machinectl` fails with the error "machinectl: invalid option -- 'c'".

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
`lib/ansible/plugins/become/machinectl.py`

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.7.10
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/thomas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
<no output>
```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
Host: Arch Linux x64
Target: Ubuntu 16.04.6 Desktop 64-bits

Target machinectl version:
```
$ machinectl --version
systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN
```

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
$ ansible -m ping --user thomas --become --become-user somebody --become-method machinectl target-machine
```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
No error, `machinectl` should just work. (I need to use `machinectl` because I want to create/start a systemd user service running as `somebody`, while `somebody` may not be logged in.)

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

With `-vvvv` (lots of spammy ssh output): [gist](https://gist.github.com/ttencate/36b75976a3564b8cd59ce1562c906c89)

From the output we can see that Ansible is running this command on the target:

```
machinectl shell -q  somebody@ /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-kppmktulvryalmvucprbybyfjgvsiseh; /usr/bin/python /var/tmp/ansible-tmp-1558089659.8620167-87402387160364/AnsiballZ_ping.py'"'"'"'"'"'"'"'"' && sleep 0
```

On the Ubuntu target (systemd 229), that fails:

```
$ machinectl shell -q somebody@ /bin/sh -c 'echo foo'
machinectl: invalid option -- 'c'
```

On the Arch Linux host (systemd 242), it succeeds:

```
$ machinectl shell -q thomas@ /bin/sh -c 'echo foo'
[...]
foo
```

The cause seems to be [systemd issue #2420](https://github.com/systemd/systemd/issues/2420), which presumably was fixed just too late to make it into the Ubuntu 16.04 release. A simple workaround is to add `--` before the actual command, which terminates the option list and works on both old and new [edit 2019-07-05: no it doesn't, see below!]:

```
$ machinectl shell -q somebody@ -- /bin/sh -c 'echo foo'
[...]
foo
```

{'base_commit': '2897cf43cea3d61b9673ce14ba796a663d99f19d', 'files': [{'path': 'lib/ansible/plugins/become/machinectl.py', 'status': 'modified', 'Loc': {"('BecomeModule', 'build_become_command', 78)": {'mod': [87]}}}]}


(DOC) A `string` passed to `groupby` is hard to understand based on current doc

#### Code Sample, a copy-pastable example if possible
From [Here](pandas/doc/source/groupby.rst)
```rst
For DataFrame objects, a string indicating a column to be used to group. Of course
df.groupby('A') is just syntactic sugar for df.groupby(df['A']), but
it makes life simpler
For DataFrame objects, a string indicating an index level to be used to group.

```
#### Problem description

These two sentences are in a kind of conflict with each other, until one read until she read the note below.
#### Expected Output
Reword to make it clear that a string may indicate column or index level

#### Output of ``pd.show_versions()``

<details>
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.3.final.0
python-bits: 64
OS: Darwin
OS-release: 16.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.21.0.dev+193.gb2b5dc32e
pytest: 3.1.2
pip: 9.0.1
setuptools: 36.0.1
Cython: 0.25.2
numpy: 1.13.0
scipy: 0.19.0
xarray: None
IPython: 6.0.0
sphinx: 1.6.2
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: 1.2.1
tables: None
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None
</details>

{'base_commit': 'b5a5268dabb2a4dea1c3c543a1ddff501b87a447', 'files': [{'path': 'doc/source/user_guide/groupby.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [90, 91, 92, 93, 94]}}}]}


Indexing
API Design
Deprecate
Needs Discussion

DEPR: filter & select

do we need label selectors? we should for sure just have a single method for this. maybe call it `query_labels`? to be consistent with `.query` as the workhorse for data selection.

- [x] ``.select`` (#17633)
- [ ] ``.filter``

xref #6599


when using GUI recent version, A converting error has occurred.

I am testing the gui version downloaded today. But when converting,  the following error has occurred.
Can anyone tell me what I am doing wrong or how to solve it?

(1) error message
"Failed to convert image: ...\faceA_source_gui\out1.png. Reason: argument of type 'NoneType' is not iterable"

(1) train image :
https://imgur.com/tLB15CB

(2) convert error image :
https://imgur.com/OAzWKdR


gpt4free useless: IndexError: list index out of range

**Bug description**
Telegram bot using gpt4free not working
main.py:
```import telebot
from gpt4free import usesless

bot = telebot.TeleBot('my_token')

@bot.message_handler(commands=['start'])
def send_welcome(message):
    bot.reply_to(message, "ChatGPT unlimited and free but without memory")

@bot.message_handler()
def test(message):
  prompt = ""
  req = usesless.Completion.create(prompt=prompt)
  prompt = message.text
  bot.reply_to(message, req["text"])

if __name__ == "__main__":
  bot.polling()
```
Error:
```
Traceback (most recent call last): File "main.py", line 20, in <module> bot.polling()

File "/home/runner/Test/venv/lib/python3.1

0/site-packages/telebot/__init__.py", line 1 043, in polling self.__threaded_polling (non_stop=non_sto p, interval=interval, timeout=timeout, long_

polling_timeout-long_polling_timeout,

File "/home/runner/Test/venv/lib/python3.1

0/site-packages/telebot/__init__.py", line 1 118, in __threaded_polling

raise e

File "/home/runner/Test/venv/lib/python3.1 0/site-packages/telebot/__init__.py", line 1 074, in threaded_polling

self.worker_pool.raise_exceptions() File "/home/runner/Test/venv/lib/python3.1 0/site-packages/telebot/util.py", line 147, in raise_exceptions

raise self.exception_info File "/home/runner/Test/venv/lib/python3.1 0/site-packages/telebot/util.py", line 90, i n run

task(*args, **kwargs) File "/home/runner/Test/venv/lib/python3.1 0/site-packages/telebot/__init__.py", line 6 770, in _run_middlewares_and_handler result = handler['function'](message)

File "main.py", line 15, in test

req = usesless.Completion.create(prompt=prompt) File "/home/runner/Test/venv/lib/python3.1 0/site-packages/gpt4free/usesless/__init__.py", line 46, in create

response = Completion.__response_to_json (content) File "/home/runner/Test/venv/lib/python3.10/site-packages/gpt4free/usesless/__init__.py", line 53, in __response_to_json split_text = text.rsplit("\n", 1)[1]

IndexError: list index out of range
```

**Environement**
- python version 3.10
- server location Poland

**Additional context**
If you need more information to help me, please let me know.


HDF5 Normalizer not working.

```
def preprocess_train(array):
    """ Given a batch of numpy arrays, it outputs a batch of numpy of arrays with all preprocessing

    size : (w, h)
    """
    num1 = np.random.randint(0, 128 - 112)
    num2 = np.random.randint(0, 171 - 112)
    crop = array[ :, num1:num1+112, num2:num2+112, :]
    crop = crop/255.0
    return  crop
```
```
X_train = HDF5Matrix(train_loc, 'images', start=0, normalizer=preprocess_train)
y_train = HDF5Matrix(train_loc, 'labels')
````
```
model_final.fit(X_train, y_train, batch_size=16, shuffle='batch', validation_data = [X_test, y_test], epochs=10)
```
```
ValueError: Error when checking model input: expected conv1_input to have shape (None, 16, 112, 112, 3) but got array with shape (5797, 16, 128, 171, 3)
```
Basically I have a h5py file with shape (5797, 16, 128, 171, 3) and my preprocess function should output (16, 112, 112, 3). this is not happening.

However when I run only X_train and used X_train.__getitem___(1). It outputs an array with (16, 112, 112, 3) shape.

Not sure where I am going wrong. Can someone help me ?


Instructions don't result in homeassistant listening on any port

Neither of these result in homeassistant listening on port `8123`

``` bash
python3 -m homeassistant
python3 -m homeassistant --config=config
```

In fact, it isn't seeming to be listening on _any_ port.

``` bash
(ve)[jeff@omniscience home-assistant] (master)$ ./build_frontend
(ve)[jeff@omniscience home-assistant] (master)$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   build_frontend
    deleted:    config/home-assistant.conf.example
    modified:   homeassistant/components/http/frontend.py
    modified:   homeassistant/components/http/www_static/frontend.html

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    ve/

no changes added to commit (use "git add" and/or "git commit -a")
(ve)[jeff@omniscience home-assistant] (master)$ python3 -m homeassistant --config config
INFO:homeassistant.loader:Loaded component demo from homeassistant.components.demo
ERROR:homeassistant.loader:Error loading homeassistant.components.http
Traceback (most recent call last):
  File "/home/jeff/git/home-assistant/homeassistant/loader.py", line 91, in _get_component
    comp = importlib.import_module(module)
  File "/usr/lib64/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/jeff/git/home-assistant/homeassistant/components/http/__init__.py", line 86, in <module>
    import homeassistant.remote as rem
  File "/home/jeff/git/home-assistant/homeassistant/remote.py", line 18, in <module>
    import requests
ImportError: No module named 'requests'
ERROR:homeassistant.loader:Unable to load component http
INFO:homeassistant.loader:Loaded component group from homeassistant.components.group
INFO:homeassistant.bootstrap:Home Assistant core initialized
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=a.Demo_Mode, new_state=<state Enabled @ 22:30:15 06-11-2014>>
INFO:homeassistant.loader:Loaded component sun from homeassistant.components.sun
ERROR:homeassistant.components.sun:Error while importing dependency ephem.
Traceback (most recent call last):
  File "/home/jeff/git/home-assistant/homeassistant/components/sun.py", line 66, in setup
    import ephem
ImportError: No module named 'ephem'
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=light.Bowl, new_state=<state on:xy_color=[0.861, 0.3259], brightness=200 @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=light.Ceiling, new_state=<state on:xy_color=[0.1684, 0.0416], brightness=200 @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=light.TV_Back_light, new_state=<state off @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=light.Bed_light, new_state=<state off @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=group.all_lights, new_state=<state on:entity_id=['light.Bowl', 'light.Ceiling', 'light.TV_Back_light', 'light.Bed_light'], auto=True @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=wemo.AC, new_state=<state on @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=wemo.Christmas_Lights, new_state=<state off @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=group.living_room, new_state=<state on:entity_id=['light.Bowl', 'light.Ceiling', 'light.TV_Back_light', 'wemo.AC'], auto=False @ 22:30:15 06-11-2014>>
ERROR:homeassistant:WorkerPool:All 4 threads are busy and 17 jobs pending
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=group.bedroom, new_state=<state off:entity_id=['light.Bed_light', 'wemo.Christmas_Lights'], auto=False @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=process.XBMC, new_state=<state on @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=device_tracker.Paulus, new_state=<state home:entity_picture=http://graph.facebook.com/schoutsen/picture @ 22:30:15 06-11-2014>>
ERROR:homeassistant:WorkerPool:All 4 threads are busy and 33 jobs pending
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=device_tracker.Anne_Therese, new_state=<state not_home:entity_picture=http://graph.facebook.com/anne.t.frederiksen/picture @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=group.all_devices, new_state=<state home:entity_id=['device_tracker.Paulus', 'device_tracker.Anne_Therese'], auto=True @ 22:30:15 06-11-2014>>
INFO:homeassistant:Bus:Handling <Event state_changed[L]: entity_id=chromecast.Living_Rm, new_state=<state Netflix:friendly_name=Living Room @ 22:30:15 06-11-2014>>
INFO:homeassistant.bootstrap:component demo initialized
INFO:homeassistant.bootstrap:component group initialized
INFO:homeassistant:Bus:Handling <Event homeassistant_start[L]>
INFO:homeassistant:Timer:starting
INFO:homeassistant:Bus:Handling <Event time_changed[L]: now=22:30:20 06-11-2014>
^C
```

Sadly, I can't use the docker container due to [docker being broken in Fedora 21](https://github.com/docker/docker/issues/7952) right now. So while it is running, I tried `lsof -i tcp:8123` and `lsof -p $(pidof python3)`

This is with Python 3.4.1 on Fedora 21 (pre-release) x86_64.

FYI: I work on python automation code and django apps for `$REAL_JOB` and would love to help you improve this software if at all possible. I've got a home Insteon network and have SONOS speakers throughout the house. Once I get this all working, one of the first things I'd like to write is the integration between this and the SONOS xml api

{'base_commit': '8c8feb95a9c9048d655bc1eb263f6bc6ee61ee74', 'files': [{'path': 'homeassistant/components/google_assistant/helpers.py', 'status': 'modified', 'Loc': {"('GoogleEntity', 'sync_serialize', 393)": {'add': [428]}}}, {'path': 'tests/components/google_assistant/test_helpers.py', 'status': 'modified', 'Loc': {"(None, 'test_google_entity_sync_serialize_with_local_sdk', 25)": {'mod': [47, 48, 49, 50, 51, 52, 53, 54, 55]}}}]}


Cookie support?

An feature request (not found in documentation).

Does this support cookies?

Usecase: I can integrate this module inside an existings framework. This framework generate for me the authentication/session cookie, so to perform request using requests there I need to add the same auth cookie already generated.

并没有找到对应的pr，这一行提供的pr也无法解决issue问题，在issue中解决问题的是一个commit


Brittle test

The test `test_expires_valid_str` fails on my OS X box, in Python 2.7:

``` python
============================= test session starts ==============================
platform darwin -- Python 2.7.5 -- pytest-2.3.4
plugins: cov
collected 116 items

test_requests.py .................................................................................................................F..

=================================== FAILURES ===================================
_______________ TestMorselToCookieExpires.test_expires_valid_str _______________

self = <test_requests.TestMorselToCookieExpires testMethod=test_expires_valid_str>

    def test_expires_valid_str(self):
        """Test case where we convert expires from string time."""

        morsel = Morsel()
        morsel['expires'] = 'Thu, 01-Jan-1970 00:00:01 GMT'
        cookie = morsel_to_cookie(morsel)
>       assert cookie.expires == 1
E       AssertionError: assert -3599 == 1
E        +  where -3599 = Cookie(version=0, name=None, value=None, port=None, port_specified=False, domain='', domain_specified=False, domain_in...False, secure=False, expires=-3599, discard=False, comment='', comment_url=False, rest={'HttpOnly': ''}, rfc2109=False).expires

test_requests.py:1111: AssertionError
==================== 1 failed, 115 passed in 23.32 seconds =====================
```

I've not yet got a good theory for this, though I think it's telling that the error is one hour. I don't know _what_ it's telling though, because time is complicated.

Anyway, this test needs to be rewritten to be more accepting of breakage. It's also possible that the intermittent failure of this test represents a problem with the `morsel_to_cookie` function itself, in which case that needs rewriting.


UnicodeDecodeError when using thefuck

I followed the alias guide, but I got an error when running thefuck in PowerShell:
```
Traceback (most recent call last):
  File "d:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Python36\Scripts\thefuck.exe\__main__.py", line 9, in <module>
  File "d:\python36\lib\site-packages\thefuck\entrypoints\main.py", line 26, in main
    fix_command(known_args)
  File "d:\python36\lib\site-packages\thefuck\entrypoints\fix_command.py", line 36, in fix_command
    command = types.Command.from_raw_script(raw_command)
  File "d:\python36\lib\site-packages\thefuck\types.py", line 82, in from_raw_script
    output = get_output(script, expanded)
  File "d:\python36\lib\site-packages\thefuck\output_readers\__init__.py", line 20, in get_output
    return rerun.get_output(script, expanded)
  File "d:\python36\lib\site-packages\thefuck\output_readers\rerun.py", line 62, in get_output
    output = result.stdout.read().decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 9: invalid start byte
```

{'base_commit': '58ddd4338adf12a3abc2ffed0e27794a398fa8d2', 'files': [{'path': 'tests/output_readers/test_rerun.py', 'status': 'modified', 'Loc': {"('TestRerun', None, 9)": {'add': [24]}}}, {'path': 'thefuck/output_readers/rerun.py', 'status': 'modified', 'Loc': {"(None, 'get_output', 45)": {'mod': [63]}}}]}


Some faces with one eye hair covered can't be recognized

*First THANKS A LOT for all contributors' hard work!
*Always make a compare test after big change, test with same source 1000 pics (kar801 -> kar1800) , compare with FakeApp1.1 & latest faceswap commit 232d931.
*Test files [Link Removed]
## Expected behavior
Not sure, limitation ? or possible to improve ?

## Actual behavior
FakeApp1.1 extract rate is 988/1000
faceswap -D cnn extract rate is 943/1000

[Image Removed]

Notice that some faces - specially one eye covered by hair can't be extract. Example: kar1086 -> kar1090, these 5 pics can be extract normally in FakeApp, but failed in faceswap. Compare kar1085 with kar1086, no big gap in these 2 pics, just corner of the eye be covered by hair in kar1086.

## Steps to reproduce
python faceswap.py extract -i D:/project4/data_A1/ -o D:/project4/data_A1/output/ -D cnn

## Other relevant information

- **Operating system and version:** Windows, macOS, Linux
Windows10
Python3.6.4
CUDA9.0
dlib 19.9
The others env same as requirements-gpu-python36-cuda9.txt


Doc styling utils adds parasites new lines

## Environment info

- `transformers` version: 4.2.0dev0
- Platform: Windows-10-10.0.18362-SP0
- Python version: 3.7.9
- PyTorch version (GPU?): 1.7.1 (False)
- Tensorflow version (GPU?): 2.3.1 (False)
- Using GPU in script?: Nope
- Using distributed or parallel set-up in script?: Nope

### Who can help

@sgugger

## Information

Running the python util to style docs adds parasite new lines in every single docstring. See:

```bash
$ python utils/style_doc.py src/transformers docs/source --max_len 119 --check_only
Traceback (most recent call last):
  File "utils/style_doc.py", line 491, in <module>
    main(*args.files, max_len=args.max_len, check_only=args.check_only)
  File "utils/style_doc.py", line 479, in main
    raise ValueError(f"{len(changed)} files should be restyled!")
ValueError: 345 files should be restyled!
```

See this commit for an example of what it does: https://github.com/huggingface/transformers/pull/9150/commits/b4dedd5ca25f043c66d12c774fa00a34c74dffb2

## To reproduce

Steps to reproduce the behavior:

1. Checkout and update master branch
2. run `python utils/style_doc.py src/transformers docs/source --max_len 119 --check-only` from transformers root

Output:
```python
Traceback (most recent call last):
  File "utils/style_doc.py", line 491, in <module>
    main(*args.files, max_len=args.max_len, check_only=args.check_only)
  File "utils/style_doc.py", line 479, in main
    raise ValueError(f"{len(changed)} files should be restyled!")
ValueError: 345 files should be restyled!
```

It might have something to do with Windows or a particular setup of my machine because behavior cannot be reproduced by @patrickvonplaten.

## Expected behavior

On master branch, documentation should not need to be restyled

{'base_commit': '02e05fb0a532e572b56ba75dad6ba3db625bbdeb', 'files': [{'path': 'docs/source/benchmarks.rst', 'status': 'modified', 'Loc': {}}, {'path': 'utils/style_doc.py', 'status': 'modified', 'Loc': {"(None, 'style_rst_file', 378)": {'mod': [384, 386]}}}]}


Document LogFormatter

Currently, the `LogFormatter` class is only mentioned in the [Release notes](https://docs.scrapy.org/en/latest/news.html) page of the documentation. This class should be properly documented, both its API members and a small section introducing it on the documentation page about [Logging](https://docs.scrapy.org/en/latest/topics/logging.html).

The responses to [Scrapy - Silently drop an item](https://stackoverflow.com/q/13527921/939364) in StackOverflow would be a good starting point.


I'm trying crawl ~200k sites, only the home pages. In the beginning the crawl works fine but the logs quickly fill up with the following errors:

2017-08-29 11:18:55,131 - scrapy.core.scraper - ERROR - Error downloading <GET http://axo-suit.eu>
Traceback (most recent call last):
  File "venv/lib/python3.6/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "venv/lib/python3.6/site-packages/twisted/python/failure.py", line 393, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "venv/lib/python3.6/site-packages/scrapy/core/downloader/middleware.py", line 43, in process_request
    defer.returnValue((yield download_func(request=request,spider=spider)))
twisted.internet.error.ConnectError: An error occurred while connecting: [Failure instance: Traceback: <class 'ValueError'>: filedescriptor out of range in select()
venv/lib/python3.6/site-packages/twisted/internet/base.py:1243:run
venv/lib/python3.6/site-packages/twisted/internet/base.py:1255:mainLoop
venv/lib/python3.6/site-packages/twisted/internet/selectreactor.py:106:doSelect
venv/lib/python3.6/site-packages/twisted/internet/selectreactor.py:88:_preenDescriptors
--- <exception caught here> ---
venv/lib/python3.6/site-packages/twisted/internet/selectreactor.py:85:_preenDescriptors
].

lsof shows that the process indeed has >1024 open network connections, which I believe is the limit for select().

I set CONCURRENT_REQUESTS = 100 and REACTOR_THREADPOOL_MAXSIZE = 20 based on https://doc.scrapy.org/en/latest/topics/broad-crawls.html.

Not sure how the crawl ends up with so many open connections. Maybe it's leaking filedescriptors somewhere?

I'm using:
Python 3.6.2
Scrapy 1.4.0
Twisted 17.5.0
macOS Sierra 10.12.6

Happy to provide more info as needed.

{'base_commit': '47b9de93a9c7a514f4007439335facd8ea82a12d', 'files': [{'path': 'docs/faq.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [363]}}}, {'path': 'docs/topics/broad-crawls.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [213]}}}, {'path': 'docs/topics/settings.rst', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [1465], 'mod': [163, 165, 166, 168, 170, 172, 173, 174, 175, 176, 177, 178, 180, 181, 182]}}}, {'path': 'pytest.ini', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [23], 'mod': [112, 132, 138]}}}, {'path': 'scrapy/crawler.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [25], 'mod': [16]}, "('CrawlerRunner', '__init__', 133)": {'mod': [141]}, "('CrawlerRunner', None, 114)": {'mod': [235, 236, 237, 238]}, "('CrawlerProcess', None, 241)": {'mod': [327, 328, 329, 330]}}}, {'path': 'scrapy/settings/default_settings.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [293], 'mod': [22]}}}, {'path': 'scrapy/utils/asyncio.py', 'status': 'removed', 'Loc': {}}, {'path': 'scrapy/utils/defer.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [6], 'mod': [5, 12]}}}, {'path': 'scrapy/utils/log.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [4, 9], 'mod': [3, 8, 12, 14]}, "(None, 'log_scrapy_info', 145)": {'mod': [152, 153]}}}, {'path': 'scrapy/utils/reactor.py', 'status': 'modified', 'Loc': {"('CallLaterOnce', '__call__', 42)": {'add': [44]}, '(None, None, None)': {'mod': [1]}}}, {'path': 'tests/CrawlerProcess/asyncio_enabled_no_reactor.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [13]}}}, {'path': 'tests/CrawlerProcess/asyncio_enabled_reactor.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [18]}}}, {'path': 'tests/test_commands.py', 'status': 'modified', 'Loc': {"('RunSpiderCommandTest', 'test_asyncio_enabled_true', 298)": {'mod': [299, 300]}, "('RunSpiderCommandTest', 'test_asyncio_enabled_false', 302)": {'mod': [303, 304]}}}, {'path': 'tests/test_crawler.py', 'status': 'modified', 'Loc': {"('CrawlerProcessSubprocess', 'test_ipv6_alternative_name_resolver', 315)": {'add': [325]}, "('CrawlerRunnerHasSpider', 'test_crawler_runner_asyncio_enabled_true', 255)": {'mod': [257, 259, 261]}, "('CrawlerRunnerHasSpider', 'test_crawler_process_asyncio_enabled_true', 264)": {'mod': [267, 269, 271, 273]}, "('CrawlerRunnerHasSpider', 'test_crawler_process_asyncio_enabled_false', 276)": {'mod': [277, 280]}, "('CrawlerProcessSubprocess', 'test_simple', 294)": {'mod': [297]}, "('CrawlerProcessSubprocess', 'test_asyncio_enabled_no_reactor', 299)": {'mod': [302]}, "('CrawlerProcessSubprocess', 'test_asyncio_enabled_reactor', 304)": {'mod': [307]}}}, {'path': 'tests/test_utils_asyncio.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [5]}, "('AsyncioTest', 'test_install_asyncio_reactor', 15)": {'mod': [17]}}}]}


Flask.auto_find_instance_path() can return wrong path for namespace packages installed in development mode

https://github.com/pallets/flask/blob/bd56d19b167822a9a23e2e9e2a07ccccc36baa8d/src/flask/scaffold.py#L798

If there are several packages under the same namespace, all installed in development mode, like:

```
~/namespace-package1/
    namespace/
        package1/
            __init__.py
            app.py
    instance/

~/namespace-package2/
    namespace/
        package2/
            __init__.py
            app.py
    instance/
```
and the code in `namespace.package2` uses `app.instance_path`, then its expected value is `~/namespace-package2/instance` (["Uninstalled package" decision path](https://flask.palletsprojects.com/en/2.1.x/config/#instance-folders)).

Instead of that the following happens:
* `find_package()` [cuts import info](https://github.com/pallets/flask/blob/bd56d19b167822a9a23e2e9e2a07ccccc36baa8d/src/flask/scaffold.py#L846) to the very top package name, `namespace`,
* then `_find_package_path()` finds module specification for the whole namespace package, which contains several submodule search locations, like `ModuleSpec(name='namespace', loader=<_frozen_importlib_external._NamespaceLoader object at ...>, submodule_search_locations=_NamespacePath(['~/namespace-package1/namespace', '~/namespace-package2/namespace']))`
* and then the quoted line returns first, i.e. _arbitrary_, package from that namespace, e.g. `~/namespace-package1`, which produces wrong instance path.

Suggestion: pass also `import_name` into `_find_package_path` and use it for resolving ambiguity at this point, like:

```
def _find_package_path(root_mod_name, import_name):
...
            if spec.origin in {"namespace", None}:
                package_spec = importlib.util.find_spec(import_name)
                package_path = os.path.commonpath(package_spec.submodule_search_locations)
                return os.path.dirname(next(
                    location for location in spec.submodule_search_locations
                    if package_path.startswith(location)
                ))
```


some tokenizer(s) don't save the updated attributes

### System Info

transformers version: 4.25.0.dev0
Torch version: 1.13.0+cpu
Cuda available: False
Cuda version: None
CuDNN version: None
Number of GPUs available: 0

### Description

For `GPT2Tokenizer(Fast)`, Set `tokenizer.model_max_length` to `128` (originally `1024`), save it then reload, will give `tokenizer.model_max_length` being `1024`.

### Reproduction

```python
from transformers import GPT2Tokenizer, GPT2TokenizerFast

tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")
print(tokenizer.model_max_length)

tokenizer.model_max_length = 128
print(tokenizer.model_max_length)

tokenizer.save_pretrained("my-gpt2")
tokenizer_loaded = GPT2TokenizerFast.from_pretrained("my-gpt2")
print(tokenizer_loaded.model_max_length)
```

The output is

```bash
1024
128
1024

```

### Expected behavior

`tokenizer_loaded.model_max_length` should be `128` in the above example. In general, the updated attribute(s) should be saved.

{'base_commit': '0ee71188ff184ee5f8b70081665858301fe4afb1', 'files': [{'path': 'src/transformers/tokenization_utils_base.py', 'status': 'modified', 'Loc': {"('PreTrainedTokenizerBase', 'save_pretrained', 2022)": {'add': [2084]}}}]}


KeyError in apply_edits breaking improve mode

I am running improve mode, creating c# and xaml. GPT Engineer is attempting to make updates to a xaml user control (here renamed to be "myExistingUserControl.xaml") and running into an issue where the filepath is invalid.

```These edits will ensure that the code changes are in the correct format and can be found in the code.Traceback (most recent call last):

  File "<frozen runpy>", line 198, in _run_module_as_main

  File "<frozen runpy>", line 88, in _run_code

  File "C:\Users\asdf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts\gpte.exe\__main__.py", line 7, in <module>
    sys.exit(app())
             ^^^^^

  File "C:\Users\asdf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gpt_engineer\applications\cli\main.py", line 194, in main
    files_dict = agent.improve(files_dict, prompt)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\asdf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gpt_engineer\applications\cli\cli_agent.py", line 131, in improve
    files_dict = self.improve_fn(
                 ^^^^^^^^^^^^^^^^

  File "C:\Users\asdf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gpt_engineer\core\default\steps.py", line 182, in improve
    overwrite_code_with_edits(chat, files_dict)

  File "C:\Users\asdf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gpt_engineer\core\chat_to_files.py", line 97, in overwrite_code_with_edits
    apply_edits(edits, files_dict)

  File "C:\Users\asdf\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gpt_engineer\core\chat_to_files.py", line 185, in apply_edits
    occurrences_cnt = files_dict[filename].count(edit.before)
                      ~~~~~~~~~~^^^^^^^^^^

KeyError: 'some/dir/myExistingUserControl.xaml'```

{'base_commit': 'c6dd5237428895c0ba6cda40e3b2b95012276a05', 'files': [{'path': 'gpt_engineer/preprompts/improve', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [67], 'mod': [11, 32, 41, 52]}}}, {'path': 'tests/core/test_chat_to_files.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'add': [185]}, "(None, 'test_apply_edit_new_file', 186)": {'mod': [188, 191]}}}]}


Images in MPO Format are considered corrupted

I am using images taken by a DJI drone. These images are deemed corrupted by the dataset loader, and are thus not used.
This happens because in datasets.py the `im.format` is checked against a list of formats that doesn't contain "mpo".
If I add that entry manually everything works as expected.

MPO is a container format, that can contain any of the valid formats.

## 🐛 Bug
Images that report "MPO" as PIL.Image.format are deemed corrupted.

## To Reproduce (REQUIRED)
Try to load MPO images.
![DJI_0180](https://user-images.githubusercontent.com/5763229/110967292-819e6680-8356-11eb-97f0-35e6be8cc00b.JPG)

I'm not sure whether Github tempers with the image. If necessary I can upload somewhere else.

## Expected behavior
Images should be considered valid.

{'base_commit': '77415a42e5975ea356393c9f1d5cff0ae8acae2c', 'files': [{'path': 'utils/datasets.py', 'status': 'modified', 'Loc': {'(None, None, None)': {'mod': [29]}}}]}


crash in MeanShift tests after make cython (edited from k_means)

The crash:

```
[erg@pliny scikit-learn]$ [master*] nosetests -v
/home/erg/python/scikit-learn/sklearn/feature_selection/selector_mixin.py:7: DeprecationWarning: sklearn.feature_selection.selector_mixin.SelectorMixin has been renamed sklearn.feature_selection.from_model._LearntSelectorMixin, and this alias will be removed in version 0.16
  DeprecationWarning)
Affinity Propagation algorithm ... ok
Tests the DBSCAN algorithm with a similarity array. ... ok
Tests the DBSCAN algorithm with a feature vector array. ... ok
Tests the DBSCAN algorithm with a callable metric. ... ok
sklearn.cluster.tests.test_dbscan.test_pickle ... ok
Check that we obtain the correct solution for structured ward tree. ... ok
Check that we obtain the correct solution for unstructured ward tree. ... ok
Check that the height of ward tree is sorted. ... ok
Check that we obtain the correct number of clusters with Ward clustering. ... ok
Check that we obtain the correct solution in a simplistic case ... ok
Test scikit ward with full connectivity (i.e. unstructured) vs scipy ... ok
Check that connectivity in the ward tree is propagated correctly during ... ok
Check non regression of a bug if a non item assignable connectivity is ... ok
sklearn.cluster.tests.test_k_means.test_square_norms ... ok
sklearn.cluster.tests.test_k_means.test_kmeans_dtype ... ok
sklearn.cluster.tests.test_k_means.test_labels_assignment_and_inertia ... ok
Check that dense and sparse minibatch update give the same results ... ok
sklearn.cluster.tests.test_k_means.test_k_means_plus_plus_init ... ok
sklearn.cluster.tests.test_k_means.test_k_means_check_fitted ... ok
sklearn.cluster.tests.test_k_means.test_k_means_new_centers ... ok
sklearn.cluster.tests.test_k_means.test_k_means_plus_plus_init_2_jobs ... ok
sklearn.cluster.tests.test_k_means.test_k_means_plus_plus_init_sparse ... ok
sklearn.cluster.tests.test_k_means.test_k_means_random_init ... ok
sklearn.cluster.tests.test_k_means.test_k_means_random_init_sparse ... ok
sklearn.cluster.tests.test_k_means.test_k_means_plus_plus_init_not_precomputed ... ok
sklearn.cluster.tests.test_k_means.test_k_means_random_init_not_precomputed ... ok
sklearn.cluster.tests.test_k_means.test_k_means_perfect_init ... ok
sklearn.cluster.tests.test_k_means.test_mb_k_means_plus_plus_init_dense_array ... ok
sklearn.cluster.tests.test_k_means.test_mb_kmeans_verbose ... ok
sklearn.cluster.tests.test_k_means.test_mb_k_means_plus_plus_init_sparse_matrix ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_init_with_large_k ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_k_means_random_init_dense_array ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_k_means_random_init_sparse_csr ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_k_means_perfect_init_dense_array ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_k_means_perfect_init_sparse_csr ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_reassign ... ok
sklearn.cluster.tests.test_k_means.test_sparse_mb_k_means_callable_init ... ok
sklearn.cluster.tests.test_k_means.test_mini_batch_k_means_random_init_partial_fit ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_default_init_size ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_tol ... ok
sklearn.cluster.tests.test_k_means.test_minibatch_set_init_size ... ok
sklearn.cluster.tests.test_k_means.test_k_means_invalid_init ... ok
sklearn.cluster.tests.test_k_means.test_mini_match_k_means_invalid_init ... ok
Check if copy_x=False returns nearly equal X after de-centering. ... ok
Check k_means with a bad initialization does not yield a singleton ... ok
sklearn.cluster.tests.test_k_means.test_predict ... ok
sklearn.cluster.tests.test_k_means.test_score ... ok
sklearn.cluster.tests.test_k_means.test_predict_minibatch_dense_input ... ok
sklearn.cluster.tests.test_k_means.test_predict_minibatch_kmeanspp_init_sparse_input ... ok
sklearn.cluster.tests.test_k_means.test_predict_minibatch_random_init_sparse_input ... ok
sklearn.cluster.tests.test_k_means.test_input_dtypes ... ok
sklearn.cluster.tests.test_k_means.test_transform ... ok
sklearn.cluster.tests.test_k_means.test_fit_transform ... ok
Check that increasing the number of init increases the quality ... ok
sklearn.cluster.tests.test_k_means.test_k_means_function ... ok
Test MeanShift algorithm ... Segmentation fault (core dumped)
```

Some related warnings?

```
[erg@pliny ~]$ cython --version
Cython version 0.19.1

[erg@pliny scikit-learn]$ [master*] make cython
find sklearn -name "*.pyx" | xargs cython
warning: sklearn/neighbors/binary_tree.pxi:1199:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1257:48: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1258:46: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1260:45: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1345:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1355:42: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1357:36: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1398:59: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1400:46: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1401:48: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1403:45: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1491:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1544:64: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1589:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1199:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1257:48: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1258:46: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1260:45: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1345:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1355:42: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1357:36: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1398:59: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1400:46: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1401:48: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1403:45: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1491:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1544:64: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
warning: sklearn/neighbors/binary_tree.pxi:1589:20: the result of using negative indices inside of code sections marked as 'wraparound=False' is undefined
```


Azure support broken?

### ⚠ Search for existing issues first ⚠

- [X] I have searched the existing issues, and there is no existing issue for my problem

### GPT-3 or GPT-4

- [ ] I am using Auto-GPT with GPT-3 (GPT-3.5)

### Steps to reproduce 🕹

```yaml
azure.yaml:
azure_api_type: azure
azure_api_base: https://test.openai.azure.com/
azure_api_version: 2023-03-15-preview
azure_model_map:
    fast_llm_model_deployment_id: "gpt-35-turbo"
    smart_llm_model_deployment_id: "gpt-4"
    embedding_model_deployment_id: "emb-ada"
```

### Current behavior 😯

When I run "python -m autogpt", it just broken
Welcome back!  Would you like me to return to being Entrepreneur-GPT?
Continue with the last settings?
Name:  Entrepreneur-GPT
Role:  an AI designed to autonomously develop and run businesses with the
Goals: ['Increase net worth', 'Grow Twitter Account', 'Develop and manage multiple businesses autonomously']
Continue (y/n): y
Using memory of type:  LocalCache
Using Browser:  chrome

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/data/Auto-GPT/autogpt/__main__.py", line 50, in <module>
    main()
  File "/data/Auto-GPT/autogpt/__main__.py", line 46, in main
    agent.start_interaction_loop()
  File "/data/Auto-GPT/autogpt/agent/agent.py", line 75, in start_interaction_loop
    assistant_reply = chat_with_ai(
                      ^^^^^^^^^^^^^
  File "/data/Auto-GPT/autogpt/chat.py", line 159, in chat_with_ai
    assistant_reply = create_chat_completion(
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/Auto-GPT/autogpt/llm_utils.py", line 84, in create_chat_completion
    deployment_id=CFG.get_azure_deployment_id_for_model(model),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/Auto-GPT/autogpt/config/config.py", line 120, in get_azure_deployment_id_for_model
    return self.azure_model_to_deployment_id_map[
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

### Expected behavior 🤔

It should works well.

### Your prompt 📝

```yaml
# Paste your prompt here
```

{'base_commit': '4c2a566acc37c8d95b07c023f8c52a1a2a5d15bf', 'files': [{'path': 'autogpt/config/config.py', 'status': 'modified', 'Loc': {"('Config', 'load_azure_config', 136)": {'mod': [157]}}}]}


wrong suggestion with git push --set-upstream

Thefuck is incorrectly adding the remote name at the end of the command suggestion:

```
$ git push myfork
fatal: The current branch test-branch has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream myfork test-branch

$ fuck
git push --set-upstream myfork test-branch myfork [enter/↑/↓/ctrl+c]
error: src refspec myfork does not match any.
error: failed to push some refs to 'git@github.com:waldyrious/project-foo.git'
```

{'base_commit': 'f966ecd4f5b8221ee15e843f5ec287e1f7cca940', 'files': [{'path': 'tests/rules/test_git_push.py', 'status': 'modified', 'Loc': {"(None, 'test_get_new_command', 23)": {'add': [25]}}}, {'path': 'thefuck/rules/git_push.py', 'status': 'modified', 'Loc': {"(None, 'get_new_command', 22)": {'add': [34]}}}]}