internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: feast-dev/feast

Issue:
Update the behavior of install-python-ci-dependencies
## Expected Behavior 

There's a very confusing and probably unnecessary python setup.py develop call in install-python-ci-dependencies make command that's causing this error. It should just be a call to only build protos instead

## Current Behavior

install-python-ci-dependencies:
	python -m piptools sync sdk/python/requirements/py$(PYTHON)-ci-requirements.txt
	COMPILE_GO=true python setup.py develop

## Steps to reproduce

### Specifications

- Version:
- Platform:
- Subsystem:

## Possible Solution

install-python-ci-dependencies:
	python -m piptools sync sdk/python/requirements/py$(PYTHON)-ci-requirements.txt
	pip install --no-deps -e .
	python setup.py build_python_protos --inplace



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,6 @@
     "pandas>=1.4.3,<3",
     # Higher than 4.23.4 seems to cause a seg fault
     "protobuf>=4.24.0,<5.0.0",
-    "proto-plus>=1.20.0,<2",
     "pyarrow>=4",
     "pydantic>=2.0.0",
     "pygments>=2.12.0,<3",
@@ -70,8 +69,6 @@
     # https://github.com/dask/dask/issues/10996
     "dask>=2021.1.0,<2024.3.0",
     "bowler",  # Needed for automatic repo upgrades
-    # FastAPI does not correctly pull starlette dependency on httpx see thread(https://github.com/tiangolo/fastapi/issues/5656).
-    "httpx>=0.23.3",
     "importlib-resources>=6.0.0,<7",
     "importlib_metadata>=6.8.0,<7",
 ]
@@ -163,11 +160,12 @@
         "black>=22.6.0,<23",
         "isort>=5,<6",
         "grpcio-testing>=1.56.2,<2",
+        # FastAPI does not correctly pull starlette dependency on httpx see thread(https://github.com/tiangolo/fastapi/issues/5656).
+        "httpx>=0.23.3",
         "minio==7.1.0",
         "mock==2.0.0",
         "moto<5",
         "mypy>=1.4.1",
-        "avro==1.10.0",
         "urllib3>=1.25.4,<3",
         "psutil==5.9.0",
         "py>=1.11.0",  # https://github.com/pytest-dev/pytest/issues/10420
@@ -215,14 +213,8 @@
     + GRPCIO_REQUIRED
 )
 
-
-# rtd builds fail because of mysql not being installed in their environment.
-# We can add mysql there, but it's not strictly needed. This will be faster for builds.
-DOCS_REQUIRED = CI_REQUIRED.copy()
-for _r in MYSQL_REQUIRED:
-    DOCS_REQUIRED.remove(_r)
-
-DEV_REQUIRED = ["grpcio-testing~=1.0"] + CI_REQUIRED
+DOCS_REQUIRED = CI_REQUIRED
+DEV_REQUIRED = CI_REQUIRED
 
 # Get git repo root directory
 repo_root = str(pathlib.Path(__file__).resolve().parent)


Test patch:
Repository: feast-dev/feast

Issue:
Deprecate PostgreSQLRegistryStore
Right now we have 2 ways to use postgres as a registry backend. The first is with scalable `SqlRegistry` that uses `sqlalchemy`, another is an older option of using `PostgreSQLRegistryStore` which keeps the whole proto in a single table. Since we are [recommending](https://docs.feast.dev/tutorials/using-scalable-registry) the scalable registry anyway, we should deprecate `PostgreSQLRegistryStore` and remove it soon after. Or maybe remove it directly? It's under contribs as of now.


Discussion:
I agree it make sense to remove the `PostgreSQLRegistryStore`. but it might cause incompatibility if someone still specify it in `registry_store_type`. probably need to point it to the `sqlregistry` as well.
Do you mean rewiring one registry_store_type to point to other? I think that'll be too hard to figure out as the way they store protos in the database is completely different, plus the way they are configured from `RepoConfig` is also not exactly the same. Better to deprecate it and throw a warning instructing users to move to sql registry themselves.
i mean to update https://github.com/feast-dev/feast/blob/a0f7472f200300f3a45aa404922dd67bb4ad237f/sdk/python/feast/infra/registry/registry.py#L59 to point to sqlregistry directly. not sure if that will work.
That will fail, `SqlRegistry` expects the protos to be stored in a particular way. It won't be able to read the existing registry data written previously by `PostgreSQLRegistryStore`.
> That will fail, `SqlRegistry` expects the protos to be stored in a particular way. It won't be able to read the existing registry data written previously by `PostgreSQLRegistryStore`.

I see. let's deprecate it then.

Resolving patch:
diff --git a/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py b/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py
--- a/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py
+++ b/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py
@@ -1,3 +1,4 @@
+import warnings
 from typing import Optional
 
 import psycopg2
@@ -37,6 +38,11 @@ def __init__(self, config: PostgresRegistryConfig, registry_path: str):
             sslcert_path=getattr(config, "sslcert_path", None),
             sslrootcert_path=getattr(config, "sslrootcert_path", None),
         )
+        warnings.warn(
+            "PostgreSQLRegistryStore is deprecated and will be removed in the future releases. Please use SqlRegistry instead.",
+            DeprecationWarning,
+        )
+
         self.table_name = config.path
         self.cache_ttl_seconds = config.cache_ttl_seconds
 


Test patch:
Repository: feast-dev/feast

Issue:
Remove numpy <1.25 dependency in setup.py
In setup.py, I can see that the dependency for pandas has already been updated from 
"pandas>=1.4.3,<2" (which is still in the current PyPI version) to "pandas>=1.4.3,<3", but numpy hasn't, which will break the installation if I am using e.g. pandas 2.2.1, that requires numpy (>=1.26.0,<2)

## Problem
"numpy>=1.22,<1.25"

## Solution
"numpy>=1.22,<2"

## Steps to reproduce
poetry add git+https://github.com/feast-dev/feast.git


Discussion:
@softwareentrepreneer thanks, looks like the pin was [added](https://github.com/feast-dev/feast/commit/774ed33a067bf9bf087520325b72f4f4d194106a) simply to get rid of some deprecation warnings, so this shouldn't be an issue. Would you like to open a PR?

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@
     "Jinja2>=2,<4",
     "jsonschema",
     "mmh3",
-    "numpy>=1.22,<1.25",
+    "numpy>=1.22,<2",
     "pandas>=1.4.3,<3",
     # Higher than 4.23.4 seems to cause a seg fault
     "protobuf>=4.24.0,<5.0.0",


Test patch:
Repository: alibaba/FederatedScope

Issue:
Incorrect Evaluation
In each round, multiple evaluation results are reported in the logs, each of which seems to be the results on a fraction of clients.


Discussion:

Resolving patch:
diff --git a/federatedscope/core/worker/server.py b/federatedscope/core/worker/server.py
--- a/federatedscope/core/worker/server.py
+++ b/federatedscope/core/worker/server.py
@@ -245,6 +245,9 @@ def check_and_move_on(self,
             min_received_num = self._cfg.federate.sample_client_num
         assert min_received_num <= self.sample_client_num
 
+        if check_eval_result:
+            min_received_num = len(list(self.comm_manager.neighbors.keys()))
+
         move_on_flag = True  # To record whether moving to a new training round or finishing the evaluation
         if self.check_buffer(self.state, min_received_num, check_eval_result):
 


Test patch:
Repository: alibaba/FederatedScope

Issue:
The message transformation in distributed mode is inefficient
When the shared model is large (e.g., >200M), the transformation defined in https://github.com/alibaba/FederatedScope/blob/master/federatedscope/core/message.py#L205 needs lots of time.

We need to make it more efficient


Discussion:

Resolving patch:
diff --git a/federatedscope/core/communication.py b/federatedscope/core/communication.py
--- a/federatedscope/core/communication.py
+++ b/federatedscope/core/communication.py
@@ -186,7 +186,8 @@ def _create_stub(receiver_address):
         request = message.transform(to_list=True)
         try:
             stub.sendMessage(request)
-        except grpc._channel._InactiveRpcError:
+        except grpc._channel._InactiveRpcError as error:
+            logger.warning(error)
             pass
         channel.close()
 
diff --git a/federatedscope/core/configs/cfg_fl_setting.py b/federatedscope/core/configs/cfg_fl_setting.py
--- a/federatedscope/core/configs/cfg_fl_setting.py
+++ b/federatedscope/core/configs/cfg_fl_setting.py
@@ -72,8 +72,8 @@ def extend_fl_setting_cfg(cfg):
     # data_idx = -1 means that the whole dataset is owned by the participant.
     # when data_idx is other invalid values excepted for -1, we randomly
     # sample the data_idx for simulation
-    cfg.distribute.grpc_max_send_message_length = 100 * 1024 * 1024
-    cfg.distribute.grpc_max_receive_message_length = 100 * 1024 * 1024
+    cfg.distribute.grpc_max_send_message_length = 300 * 1024 * 1024  # 300M
+    cfg.distribute.grpc_max_receive_message_length = 300 * 1024 * 1024  # 300M
     cfg.distribute.grpc_enable_http_proxy = False
     cfg.distribute.grpc_compression = 'nocompression'  # [deflate, gzip]
 


Test patch:
Repository: alibaba/FederatedScope

Issue:
Message asked for local pretraining is missing the "content" para when train a graph model in distributed mode?

If no "content" para, there will raise ValueError('The data type {} has not been supported.'.format(type(value))) in Message.create_by_type() function.


Discussion:
Thanks a lot for your interest! This issue is caused by that NoneType is not supported by grpc proto, you can change None to a string (such as 'None') as a workaround.

Resolving patch:
diff --git a/federatedscope/core/message.py b/federatedscope/core/message.py
--- a/federatedscope/core/message.py
+++ b/federatedscope/core/message.py
@@ -21,7 +21,7 @@ def __init__(self,
                  sender=0,
                  receiver=0,
                  state=0,
-                 content=None,
+                 content='None',
                  timestamp=0,
                  strategy=None):
         self._msg_type = msg_type


Test patch:
Repository: alibaba/FederatedScope

Issue:
A bug  when performing asynchronous FL 
**Describe the bug**

When performing asynchronous FL, if we set client_num = 50 and sample_client_num > 47 (e.g., 48), the training procedure will remain stagnant in round #0 and never get into round #1. 

**To Reproduce**
Steps to reproduce the behavior:
1. Specify the FL settings as in FederatedScope/scripts/example_configs/asyn_cifar10.yaml.
2. Set "cfg.federate.client_num = 50" and "cfg.federate.sample_client_num = 48"
3. Run with command  
     ```python federatedscope/main.py --cfg scripts/example_configs/asyn_cifar10.yaml```
5. The training logs are as follows.

**Screenshots**
<img width="918" alt="image" src="https://user-images.githubusercontent.com/45845531/225267160-8b125511-e381-4c4e-a3c0-5792db773cbd.png">




Discussion:

Resolving patch:
diff --git a/federatedscope/core/fed_runner.py b/federatedscope/core/fed_runner.py
--- a/federatedscope/core/fed_runner.py
+++ b/federatedscope/core/fed_runner.py
@@ -59,6 +59,7 @@ def __init__(self,
             config.ready_for_run()
         self.cfg = config
         self.client_cfgs = client_configs
+        self.serial_num_for_msg = 0
 
         self.mode = self.cfg.federate.mode.lower()
         self.gpu_manager = GPUManager(gpu_available=self.cfg.use_gpu,
@@ -471,6 +472,8 @@ def _run_simulation(self):
                     # For the server, move the received message to a
                     # cache for reordering the messages according to
                     # the timestamps
+                    msg.serial_num = self.serial_num_for_msg
+                    self.serial_num_for_msg += 1
                     heapq.heappush(server_msg_cache, msg)
                 else:
                     self._handle_msg(msg)
diff --git a/federatedscope/core/message.py b/federatedscope/core/message.py
--- a/federatedscope/core/message.py
+++ b/federatedscope/core/message.py
@@ -23,7 +23,8 @@ def __init__(self,
                  state=0,
                  content='None',
                  timestamp=0,
-                 strategy=None):
+                 strategy=None,
+                 serial_num=0):
         self._msg_type = msg_type
         self._sender = sender
         self._receiver = receiver
@@ -31,6 +32,7 @@ def __init__(self,
         self._content = content
         self._timestamp = timestamp
         self._strategy = strategy
+        self.serial_num = serial_num
 
     @property
     def msg_type(self):
@@ -93,8 +95,10 @@ def strategy(self, value):
     def __lt__(self, other):
         if self.timestamp != other.timestamp:
             return self.timestamp < other.timestamp
-        else:
+        elif self.state != other.state:
             return self.state < other.state
+        else:
+            return self.serial_num < other.serial_num
 
     def transform_to_list(self, x):
         if isinstance(x, list) or isinstance(x, tuple):


Test patch:
Repository: alibaba/FederatedScope

Issue:
The saved model is not the best model from validation set
The model is saved in the final round with latest state dict.


Discussion:

Resolving patch:
diff --git a/federatedscope/core/monitors/monitor.py b/federatedscope/core/monitors/monitor.py
--- a/federatedscope/core/monitors/monitor.py
+++ b/federatedscope/core/monitors/monitor.py
@@ -737,6 +737,7 @@ def update_best_result(self, best_results, new_results, results_type):
                     logger.error(
                         "cfg.wandb.use=True but not install the wandb package")
                     exit()
+        return update_best_this_round
 
     def add_items_to_best_result(self, best_results, new_results,
                                  results_type):
diff --git a/federatedscope/core/workers/server.py b/federatedscope/core/workers/server.py
--- a/federatedscope/core/workers/server.py
+++ b/federatedscope/core/workers/server.py
@@ -522,7 +522,8 @@ def save_best_results(self):
         """
 
         if self._cfg.federate.save_to != '':
-            self.aggregator.save_model(self._cfg.federate.save_to, self.state)
+            self.aggregator.save_model(f'final_{self._cfg.federate.save_to}',
+                                       self.state)
         formatted_best_res = self._monitor.format_eval_res(
             results=self.best_results,
             rnd="Final",
@@ -600,11 +601,18 @@ def merge_eval_results_from_all_clients(self):
                             del formatted_logs[key]
                 logger.info(formatted_logs)
                 formatted_logs_all_set.update(formatted_logs)
-                self._monitor.update_best_result(
+                update_best_this_round = self._monitor.update_best_result(
                     self.best_results,
                     metrics_all_clients,
                     results_type="unseen_client_best_individual"
                     if merge_type == "unseen" else "client_best_individual")
+                if update_best_this_round:
+                    # When the frequency of evaluations is high,
+                    # the frequency of writing to disk in the early stages
+                    # may also be high
+                    if self._cfg.federate.save_to != '':
+                        self.aggregator.save_model(self._cfg.federate.save_to,
+                                                   self.state)
                 self._monitor.save_formatted_results(formatted_logs)
                 for form in self._cfg.eval.report:
                     if form != "raw":


Test patch:
Repository: ciudadanointeligente/votainteligente-portal-electoral

Issue:
La página de agregar antecedentes no dice mucho.
Actualmente agregar más antecedentes puede ser accedida desde una sola parte:
![uploads/19ccfce5-ca60-4229-b13c-6eca8c6f144f/Captura de pantalla 2016-07-26 a las 1.29.28 p.m..png](https://s3-us-west-2.amazonaws.com/prod.huboard.com/uploads%2F19ccfce5-ca60-4229-b13c-6eca8c6f144f%2FCaptura+de+pantalla+2016-07-26+a+las+1.29.28+p.m..png)

Y debería ser accesible desde el mail de felicitaciones, la lista de tus propuestas.
Y además debería poder proveer de ejemplos que te permitan hacer de tu propuesta una más completa.
Por ejemplo en la parte donde dice "Background" debería decir algo así como: 
 "Puedes agregar más antecedentes? como por ejemplo, en qué año se inició el problema? o quizás cuantas veces han intentado darle solución?"

Además debería poder utilizarse esta información en el detalle de la propuesta.

<!---
@huboard:{"order":50.8644609375,"milestone_order":237,"custom_state":""}
-->



Discussion:

Resolving patch:
diff --git a/popular_proposal/forms/forms.py b/popular_proposal/forms/forms.py
--- a/popular_proposal/forms/forms.py
+++ b/popular_proposal/forms/forms.py
@@ -175,6 +175,10 @@ def __init__(self, *args, **kwargs):
     class Meta:
         model = PopularProposal
         fields = ['background', 'image']
+        labels = {'background': _(u'Más antecedentes sobre tu propuesta.'),
+                  'image': _(u'¿Tienes alguna imagen para compartir?')
+                  }
+        help_texts = {'background': _(u'Ejemplo: Durante el año 2011, existió una iniciativa de otra comunidad que no llegó a buen puerto.')}
 
 
 class CommentsForm(forms.Form):


Test patch:
Repository: ciudadanointeligente/votainteligente-portal-electoral

Issue:
Ordernar Propuestas
Por:
- [x] últimas creadas
- [x] Creadas por organización
- [x] Con más orazones.

Y por *defecto* puede ser:
- Random
- Por corazones, encuentro local, es organización.


Discussion:

Resolving patch:
diff --git a/popular_proposal/filters.py b/popular_proposal/filters.py
--- a/popular_proposal/filters.py
+++ b/popular_proposal/filters.py
@@ -24,6 +24,8 @@ class TextSearchForm(Form):
                            label=u"Ordenar por",
                            choices=[('', u'Por apoyos'),
                                     ('-created', u'Últimas primero'),
+                                    ('-proposer__profile__is_organization', u'De organizaciones primero'),
+                                    ('-is_local_meeting', u'Encuentros locales primero'),
                                     ])
 
     def full_clean(self):


Test patch:
Repository: opsdroid/opsdroid

Issue:
Connectors should fork
When a connector is started it should fork into its own process. This is because connectors block to accept messages from their source.

This requires #5 to enable persistent memory between connector processes.



Discussion:

Resolving patch:
diff --git a/opsdroid/core.py b/opsdroid/core.py
--- a/opsdroid/core.py
+++ b/opsdroid/core.py
@@ -3,6 +3,7 @@
 import logging
 import sys
 import weakref
+from multiprocessing import Process
 from opsdroid.helper import match
 from opsdroid.memory import Memory
 
@@ -17,6 +18,7 @@ def __init__(self):
         self.bot_name = 'opsdroid'
         self.sys_status = 0
         self.connectors = []
+        self.connector_jobs = []
         self.skills = []
         self.memory = Memory()
         logging.info("Created main opsdroid object")
@@ -56,7 +58,11 @@ def start_connectors(self, connectors):
                     connector_module["config"]["bot-name"] = self.bot_name
                     connector = cls(connector_module["config"])
                     self.connectors.append(connector)
-                    connector.connect(self)
+                    job = Process(target=connector.connect, args=(self,))
+                    job.start()
+                    self.connector_jobs.append(job)
+        for job in self.connector_jobs:
+            job.join()
 
     def start_databases(self, databases):
         """Start the databases."""


Test patch:
diff --git a/tests/test_core.py b/tests/test_core.py
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -69,8 +69,7 @@ def test_start_connectors(self):
                 "tests.mockmodules.connectors.connector")
             opsdroid.start_connectors([module])
             self.assertEqual(len(opsdroid.connectors), 1)
-            self.assertEqual(
-                len(opsdroid.connectors[0].connect.mock_calls), 1)
+            self.assertEqual(len(opsdroid.connector_jobs), 1)
 
     def test_multiple_opsdroids(self):
         with OpsDroid() as opsdroid:
Repository: opsdroid/opsdroid

Issue:
Manage logging properly
When a function calls `subprocess.Popen()` the logging seems to reset to default and print to `stdout` and `stderror`. 

This is probably because logging hasn't been configured properly. The `opsdroid` object should probably handle this as it is accessible almost everywhere.



Discussion:

Resolving patch:
diff --git a/opsdroid/loader.py b/opsdroid/loader.py
--- a/opsdroid/loader.py
+++ b/opsdroid/loader.py
@@ -5,7 +5,6 @@
 import shutil
 import subprocess
 import importlib
-import pip
 import yaml
 from opsdroid.const import (
     DEFAULT_GIT_URL, MODULES_DIRECTORY, DEFAULT_MODULE_BRANCH)
@@ -51,6 +50,19 @@ def git_clone(git_url, install_path, branch):
     process.wait()
 
 
+def pip_install_deps(requirements_path):
+    """Pip install a requirements.txt file and wait for finish."""
+    process = subprocess.Popen(["pip", "install", "-r", requirements_path],
+                               shell=False,
+                               stdout=subprocess.PIPE,
+                               stderr=subprocess.PIPE)
+    for output in process.communicate():
+        if output != "":
+            for line in output.splitlines():
+                logging.debug(str(line).strip())
+    process.wait()
+
+
 class Loader:
     """Class to load in config and modules."""
 
@@ -174,5 +186,4 @@ def _install_module(self, config):
 
             # Install module dependancies
             if os.path.isfile(config["install_path"] + "/requirements.txt"):
-                pip.main(["install", "-r", config["install_path"] +
-                          "/requirements.txt"])
+                pip_install_deps(config["install_path"] + "/requirements.txt")


Test patch:
diff --git a/tests/test_loader.py b/tests/test_loader.py
--- a/tests/test_loader.py
+++ b/tests/test_loader.py
@@ -20,6 +20,9 @@ def setup(self):
         loader = ld.Loader(opsdroid)
         return opsdroid, loader
 
+    def reset_subprocess_mocks(self):
+        sys.modules['subprocess'].mock_calls = []
+
     def test_load_config_file(self):
         opsdroid, loader = self.setup()
         config = loader.load_config_file("tests/configs/minimal.yaml")
@@ -43,10 +46,16 @@ def test_setup_modules(self):
         self.assertEqual(len(example_modules[0]["module"].mock_calls), 1)
 
     def test_git_clone(self):
+        self.reset_subprocess_mocks()
         ld.git_clone("https://github.com/rmccue/test-repository.git",
                      "/tmp/test", "master")
         self.assertNotEqual(len(sys.modules['subprocess'].mock_calls), 0)
 
+    def test_pip_install_deps(self):
+        self.reset_subprocess_mocks()
+        ld.pip_install_deps("/path/to/some/file.txt")
+        self.assertNotEqual(len(sys.modules['subprocess'].mock_calls), 0)
+
     def test_build_module_path(self):
         config = {}
         config["type"] = "test"