anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: pycqa/bandit
Issue: Importing bandit messes up console output on Windows.

**Describe the bug**
Importing bandit module changes the formatting on Windows console. This is because in one of the files, Colorama is imported and initialized without being deinitialized.

**To Reproduce**
0. Use Windows
1. Install bandit
2. Install colorama
3. print `'\\033[4mHello, World!\\033[0m'` before and after importing `bandit`.

**Expected behavior**
One should not be forced to use `Colorama` just because they imported `bandit`.

**Suggested solution**
After the bandit outputting is done, call  :
```python
colorama.deinit()
```

**Bandit version**
Since https://github.com/PyCQA/bandit/pull/424, _i.e_ since 1.6.0.


Changed files:
bandit/formatters/screen.py

diff --git a/bandit/formatters/screen.py b/bandit/formatters/screen.py
index b35d8cb..1641f1a 100644
--- a/bandit/formatters/screen.py
+++ b/bandit/formatters/screen.py
@@ -38,16 +38,20 @@ from bandit.core import constants
 from bandit.core import docs_utils
 from bandit.core import test_properties
 
+IS_WIN_PLATFORM = sys.platform.startswith('win32')
+COLORAMA = False
+
 # This fixes terminal colors not displaying properly on Windows systems.
 # Colorama will intercept any ANSI escape codes and convert them to the
 # proper Windows console API calls to change text color.
-if sys.platform.startswith('win32'):
+if IS_WIN_PLATFORM:
     try:
         import colorama
     except ImportError:
         pass
     else:
-        colorama.init()
+        COLORAMA = True
+
 
 LOG = logging.getLogger(__name__)
 
@@ -161,6 +165,9 @@ def report(manager, fileobj, sev_level, conf_level, lines=-1):
     :param lines: Number of lines to report, -1 for all
     """
 
+    if IS_WIN_PLATFORM and COLORAMA:
+        colorama.init()
+
     bits = []
     if not manager.quiet or manager.results_count(sev_level, conf_level):
         bits.append(header("Run started:%s", datetime.datetime.utcnow()))
@@ -186,3 +193,6 @@ def report(manager, fileobj, sev_level, conf_level, lines=-1):
     if fileobj.name != sys.stdout.name:
         LOG.info("Screen formatter output was not written to file: %s, "
                  "consider '-f txt'", fileobj.name)
+
+    if IS_WIN_PLATFORM and COLORAMA:
+        colorama.deinit()
Repository: dpkp/kafka-python
Issue: Connecting to a crashed broker does not try the next broker

Multi-broker support was added in a2191e5be5d5fcd212582580c163f4533cca6c73 but creating the connection does not fail over in `client.py::_send_broker_unaware_request`


Changed files:
kafka/client.py

diff --git a/kafka/client.py b/kafka/client.py
index 96cc1df..a683fe0 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -83,14 +83,14 @@ class KafkaClient(object):
         brokers. Keep trying until you succeed.
         """
         for (host, port) in self.hosts:
-            conn = self._get_conn(host, port)
             try:
+                conn = self._get_conn(host, port)
                 conn.send(requestId, request)
                 response = conn.recv(requestId)
                 return response
             except Exception, e:
-                log.warning("Could not send request [%r] to server %s, "
-                            "trying next server: %s" % (request, conn, e))
+                log.warning("Could not send request [%r] to server %s:%i, "
+                            "trying next server: %s" % (request, host, port, e))
                 continue
 
         raise KafkaUnavailableError("All servers failed to process request")
Repository: federatedai/fate
Issue: FATE1.7.0下载组件输出tracking时报错

FATE环境1.7, 部署方式为Spark, 存储使用的localfs

请求接口: http://192.168.1.225:9380/v1/tracking/component/output/data/download

入参:
{
    "job_id": "202201040605113096980",
    "role": "guest",
    "party_id": 9999,
    "component_name": "heteroLR_binaryevaluation_0",
    "limit":-1
}

响应: 
{
    "retcode": 100,
    "retmsg": "non-hexadecimal number found in fromhex() arg at position 1"
}

程序报错
Traceback (most recent call last):
  File "/data/projects/fate/fateflow/python/fate_flow/apps/tracking_app.py", line 260, in component_output_data_all
    for k, v in output_table.collect():
  File "/data/projects/fate/fate/python/fate_arch/storage/localfs/_table.py", line 83, in _collect
    yield hdfs_utils.deserialize(line.rstrip())
  File "/data/projects/fate/fate/python/fate_arch/common/hdfs_utils.py", line 29, in deserialize
    return fields[0], pickle.loads(bytes.fromhex(tmp_value))
EOFError: Ran out of input

原因是hdfs_utils中, 读取到的内容,看起来是已经结束了的, 但是还在读所以报错, 打印出了读取到的内容如下
`[hdfs_utils.deserialize] [line:28]: fields: crc^@^@^@^B^@-|GH>^_^Eh]oESCl\\'4^Nc^SFc;^PY^N^V) i^_9bOQwϹ25^A]wUt^?o+^G
<U+F520>[f(^?M^]#Q^Q-Ge_U/&S &j^KF^Q(>^U͔E)^T^N^]٧iEÑ^Wig;-^PMn^^P^]39m` tmp_value:`

本来是想自己修改掉, 但是不太清楚咱们这边是否有后续逻辑跟进!


Changed files:
python/fate_arch/storage/localfs/_table.py

diff --git a/python/fate_arch/storage/localfs/_table.py b/python/fate_arch/storage/localfs/_table.py
index 8aa828fff..7744e3322 100644
--- a/python/fate_arch/storage/localfs/_table.py
+++ b/python/fate_arch/storage/localfs/_table.py
@@ -135,7 +135,7 @@ class StorageTable(StorageTableBase):
             selector = fs.FileSelector(self.path)
             file_infos = self._local_fs_client.get_file_info(selector)
             for file_info in file_infos:
-                if file_info.base_name == "_SUCCESS":
+                if file_info.base_name.startswith(".") or file_info.base_name.startswith("_"):
                     continue
                 assert (
                     file_info.is_file