nebius/SWE-bench-extra huggingface dataset:
Repository: asottile/yesqa

Issue:
yesqa fails with ValueError if show-source is enabled
When the `flake8` option `show-source` is set to `True`, `yesqa` fails with `ValueError`.

```
Traceback (most recent call last):
  File ".../bin/yesqa", line 10, in <module>
    sys.exit(main())
  File ".../lib/python3.7/site-packages/yesqa.py", line 158, in main
    retv |= fix_file(filename)
  File ".../lib/python3.7/site-packages/yesqa.py", line 123, in fix_file
    flake8_results = _run_flake8(tmpfile.name)
  File ".../lib/python3.7/site-packages/yesqa.py", line 30, in _run_flake8
    lineno, code = line.split('\t')
ValueError: not enough values to unpack (expected 2, got 1)
```

Setting `show-source` to `False` in the flake8 configuration (in my case, `setup.cfg`) fixes the issue.

Comments:

Patch:
diff --git a/yesqa.py b/yesqa.py
index 431a8f8..860cb44 100644
--- a/yesqa.py
+++ b/yesqa.py
@@ -27,8 +27,13 @@ def _run_flake8(filename: str) -> Dict[int, Set[str]]:
     out, _ = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
     ret: Dict[int, Set[str]] = collections.defaultdict(set)
     for line in out.decode().splitlines():
-        lineno, code = line.split('\t')
-        ret[int(lineno)].add(code)
+        # TODO: use --no-show-source when that is released instead
+        try:
+            lineno, code = line.split('\t')
+        except ValueError:
+            pass  # ignore additional output besides our --format
+        else:
+            ret[int(lineno)].add(code)
     return ret
 
 


Test patch:
diff --git a/tests/yesqa_test.py b/tests/yesqa_test.py
index 0cf703c..75d1081 100644
--- a/tests/yesqa_test.py
+++ b/tests/yesqa_test.py
@@ -107,3 +107,13 @@ def test_main(tmpdir, capsys):
     assert g.read() == 'x = 1\n'
     out, _ = capsys.readouterr()
     assert out == f'Rewriting {g}\n'
+
+
+def test_show_source_in_config(tmpdir, capsys):
+    f = tmpdir.join('f.py')
+    f.write('import os  # noqa\n')
+    tmpdir.join('tox.ini').write('[flake8]\nshow_source = true\n')
+    with tmpdir.as_cwd():
+        ret = yesqa.main((str(f),))
+    assert ret == 0
+    assert f.read() == 'import os  # noqa\n'
Repository: asottile/yesqa

Issue:
yesqa turns `# noqa: F821,E501` into `# noqa: F821`, but then flake8 reports it
Here's an example:
```console
$ cat t.py 
def foo(w: Sequence[int], x: Sequence[int], y: int, z: int) -> bar: ...  # noqa: F821,E501
$ yesqa t.py 
Rewriting t.py
$ cat t.py 
def foo(w: Sequence[int], x: Sequence[int], y: int, z: int) -> bar: ...  # noqa: F821
$ flake8 t.py 
t.py:1:80: E501 line too long (85 > 79 characters)
```

Comments:

Patch:
diff --git a/yesqa.py b/yesqa.py
index 18ad40f..a0a49eb 100644
--- a/yesqa.py
+++ b/yesqa.py
@@ -7,6 +7,7 @@ import sys
 import tempfile
 from typing import Dict
 from typing import List
+from typing import Match
 from typing import Optional
 from typing import Sequence
 from typing import Set
@@ -49,12 +50,24 @@ def _remove_comments(tokens: Tokens) -> Tokens:
     for i, token in tokenize_rt.reversed_enumerate(tokens):
         if token.name == 'COMMENT':
             if NOQA_RE.search(token.src):
-                _rewrite_noqa_comment(tokens, i, collections.defaultdict(set))
+                _mask_noqa_comment(tokens, i)
             elif NOQA_FILE_RE.search(token.src):
                 _remove_comment(tokens, i)
     return tokens
 
 
+def _mask_noqa_comment(tokens: Tokens, i: int) -> None:
+    token = tokens[i]
+    match = NOQA_RE.search(token.src)
+    assert match is not None
+
+    def _sub(match: Match[str]) -> str:
+        return f'# {"."*(len(match.group())-2)}'
+
+    src = NOQA_RE.sub(_sub, token.src)
+    tokens[i] = token._replace(src=src)
+
+
 def _rewrite_noqa_comment(
         tokens: Tokens,
         i: int,


Test patch:
diff --git a/tests/yesqa_test.py b/tests/yesqa_test.py
index 75d1081..b1cb7ef 100644
--- a/tests/yesqa_test.py
+++ b/tests/yesqa_test.py
@@ -45,6 +45,8 @@ def test_non_utf8_bytes(tmpdir, capsys):
         'def f():\n'
         '    # type: () -> ' + 'A' * 65 + '  # noqa\n'
         '    pass\n',
+        'def foo(w: Sequence[int], x: Sequence[int], y: int, z: int) -> bar: ...  # noqa: E501, F821\n',
+        'def foo(w: Sequence[int]) -> bar:  # foobarfoobarfoobarfoobarfoobarfoo   # noqa: E501, F821\n',
     ),
 )
 def test_ok(assert_rewrite, src):
Repository: astropenguin/pandas-dataclasses

Issue:
Support for union type in type hints
Update typing module to allow users to use union type in `Data` and `Index`:
```python
@dataclass
class Weather(AsFrame):
    """Weather information."""

    year: Index[int]
    month: Index[int]
    temp: Data[float | None]
    wind: Data[float | None]
```
See also #115 for related discussions.

Comments:

Patch:
diff --git a/pandas_dataclasses/core/typing.py b/pandas_dataclasses/core/typing.py
index a97a6a0..161ce48 100644
--- a/pandas_dataclasses/core/typing.py
+++ b/pandas_dataclasses/core/typing.py
@@ -2,6 +2,7 @@ __all__ = ["Attr", "Column", "Data", "Index", "Other"]
 
 
 # standard library
+import types
 from dataclasses import Field
 from enum import Enum, auto
 from itertools import chain
@@ -149,6 +150,9 @@ def get_dtype(tp: Any) -> Optional[str]:
     if dtype is Any or dtype is type(None):
         return None
 
+    if is_union_type(dtype):
+        dtype = get_args(dtype)[0]
+
     if get_origin(dtype) is Literal:
         dtype = get_args(dtype)[0]
 
@@ -179,3 +183,12 @@ def get_role(tp: Any, default: Role = Role.OTHER) -> Role:
         return get_annotations(tp)[0]  # type: ignore
     except TypeError:
         return default
+
+
+def is_union_type(tp: Any) -> bool:
+    """Check if a type hint is a union type."""
+    if get_origin(tp) is Union:
+        return True
+
+    UnionType = getattr(types, "UnionType", None)
+    return UnionType is not None and isinstance(tp, UnionType)


Test patch:
diff --git a/tests/test_typing.py b/tests/test_typing.py
index de6d646..4ef0e43 100644
--- a/tests/test_typing.py
+++ b/tests/test_typing.py
@@ -16,12 +16,14 @@ testdata_dtype = [
     (Data[Any], None),
     (Data[None], None),
     (Data[int], np.dtype("i8")),
+    (Data[Union[int, None]], np.dtype("i8")),
     (Data[L["i8"]], np.dtype("i8")),
     (Data[L["boolean"]], pd.BooleanDtype()),
     (Data[L["category"]], pd.CategoricalDtype()),
     (Index[Any], None),
     (Index[None], None),
     (Index[int], np.dtype("i8")),
+    (Index[Union[int, None]], np.dtype("i8")),
     (Index[L["i8"]], np.dtype("i8")),
     (Index[L["boolean"]], pd.BooleanDtype()),
     (Index[L["category"]], pd.CategoricalDtype()),
Repository: astropenguin/pandas-dataclasses

Issue:
Rename dataspec module
- [x] Rename module (`dataspec` → `specs`)
- [x] Rename test script (`test_dataspec.py` → `test_specs.py`)

Comments:

Patch:
diff --git a/pandas_dataclasses/__init__.py b/pandas_dataclasses/__init__.py
index 7a5a5be..f6b4111 100644
--- a/pandas_dataclasses/__init__.py
+++ b/pandas_dataclasses/__init__.py
@@ -4,12 +4,12 @@ __version__ = "0.1.0"
 
 
 # submodules
-from . import dataspec
 from . import series
+from . import specs
 from . import typing
 
 
 # aliases
-from .dataspec import *
 from .series import *
+from .specs import *
 from .typing import *
diff --git a/pandas_dataclasses/series.py b/pandas_dataclasses/series.py
index eb327c8..00396a8 100644
--- a/pandas_dataclasses/series.py
+++ b/pandas_dataclasses/series.py
@@ -15,7 +15,7 @@ from typing_extensions import ParamSpec, Protocol
 
 
 # submodules
-from .dataspec import DataSpec
+from .specs import DataSpec
 from .typing import AnyDType, DataClass
 
 


Test patch:
diff --git a/pandas_dataclasses/dataspec.py b/pandas_dataclasses/specs.py
similarity index 100%
rename from pandas_dataclasses/dataspec.py
rename to pandas_dataclasses/specs.py
diff --git a/tests/test_dataspec.py b/tests/test_specs.py
similarity index 98%
rename from tests/test_dataspec.py
rename to tests/test_specs.py
index 961a35f..bd59d59 100644
--- a/tests/test_dataspec.py
+++ b/tests/test_specs.py
@@ -4,7 +4,7 @@ from dataclasses import MISSING, dataclass
 
 # dependencies
 import numpy as np
-from pandas_dataclasses.dataspec import DataSpec
+from pandas_dataclasses.specs import DataSpec
 from pandas_dataclasses.typing import Attr, Data, Index, Name
 from typing_extensions import Annotated, Literal
Repository: ateliedocodigo/py-healthcheck

Issue:
Add logger.debug if all health checks passed
As of now only [failures](https://github.com/ateliedocodigo/py-healthcheck/blob/e6205bdcc32099d12cda6eba172b4a801104448f/healthcheck/healthcheck.py#L140) and [exceptions](https://github.com/ateliedocodigo/py-healthcheck/blob/e6205bdcc32099d12cda6eba172b4a801104448f/healthcheck/healthcheck.py#L130) are logged.

Could we also log passing tests with a low log level, e.g. using `logger.debug`?

Comments:

Patch:
diff --git a/healthcheck/healthcheck.py b/healthcheck/healthcheck.py
index 25c8701..c8ae8d8 100644
--- a/healthcheck/healthcheck.py
+++ b/healthcheck/healthcheck.py
@@ -135,7 +135,10 @@ class HealthCheck(object):
         # Reduce to 6 decimal points to have consistency with timestamp
         elapsed_time = float('{:.6f}'.format(elapsed_time))
 
-        if not passed:
+        if passed:
+            msg = 'Health check "{}" passed'.format(checker.__name__)
+            logger.debug(msg)
+        else:
             msg = 'Health check "{}" failed with output "{}"'.format(checker.__name__, output)
             logger.error(msg)
 


Test patch:
diff --git a/tests/unit/test_healthcheck.py b/tests/unit/test_healthcheck.py
index bf0c7d1..7192434 100644
--- a/tests/unit/test_healthcheck.py
+++ b/tests/unit/test_healthcheck.py
@@ -31,7 +31,9 @@ class BasicHealthCheckTest(unittest.TestCase):
 
     def test_success_check(self):
         hc = HealthCheck(checkers=[self.check_that_works])
-        message, status, headers = hc.run()
+        with self.assertLogs('healthcheck', level='DEBUG') as cm:
+            message, status, headers = hc.run()
+        self.assertEqual(cm.output, ['DEBUG:healthcheck.healthcheck:Health check "check_that_works" passed'])
         self.assertEqual(200, status)
         jr = json.loads(message)
         self.assertEqual("success", jr["status"])
Repository: atscub/nautapy

Issue:
En Nauta Hogar siempre devuelve que la sesión está activa
No puede usarse en nauta hogar debido a que la web www.etecsa.cu está abierta y por tanto nautapy  siempre dice que hay una conexión activa

Comments:

Patch:
diff --git a/README.md b/README.md
index 8b50314..fe931d2 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ __NautaPy__ Python API para el portal cautivo [Nauta](https://secure.etecsa.net:
 Instalación:
 
 ```bash
-pip3 install --upgrade https://github.com/abrahamtoledo/nautapy.git#v0.2.0
+pip3 install --upgrade git+https://github.com/abrahamtoledo/nautapy.git#v0.2.0
 ```
 
 ## Modo de uso
@@ -106,6 +106,8 @@ nauta --help
 ```
 
 ## Contribuir
+__IMPORTANTE__: Notificame por Telegram sobre cualquier actividad en el proyecto (Issue o PR).
+
 Todas las contribuciones son bienvenidas. Puedes ayudar trabajando en uno de los issues existentes. 
 Clona el repo, crea una rama para el issue que estes trabajando y cuando estes listo crea un Pull Request.
 
diff --git a/nautapy/nauta_api.py b/nautapy/nauta_api.py
index 8515d1d..c12348e 100644
--- a/nautapy/nauta_api.py
+++ b/nautapy/nauta_api.py
@@ -36,7 +36,7 @@ from nautapy.exceptions import NautaLoginException, NautaLogoutException, NautaE
 
 MAX_DISCONNECT_ATTEMPTS = 10
 
-ETECSA_HOMEPAGE = "http://www.etecsa.cu"
+CHECK_PAGE = "http://www.cubadebate.cu"
 _re_login_fail_reason = re.compile('alert\("(?P<reason>[^"]*?)"\)')
 
 
@@ -110,7 +110,7 @@ class NautaProtocol(object):
 
     @classmethod
     def is_connected(cls):
-        r = requests.get(ETECSA_HOMEPAGE)
+        r = requests.get(CHECK_PAGE)
         return b'secure.etecsa.net' not in r.content
 
     @classmethod


Test patch:
diff --git a/test/test_nauta_api.py b/test/test_nauta_api.py
index 46e43a0..c4c3610 100644
--- a/test/test_nauta_api.py
+++ b/test/test_nauta_api.py
@@ -5,7 +5,7 @@ import requests
 from requests_mock import Mocker as RequestMocker, ANY
 
 from nautapy.exceptions import NautaLoginException, NautaPreLoginException
-from nautapy.nauta_api import ETECSA_HOMEPAGE, NautaProtocol
+from nautapy.nauta_api import CHECK_PAGE, NautaProtocol
 
 
 _assets_dir = os.path.join(
Repository: auth0/auth0-python

Issue:
Version 3.23.0  No longer supports RestClientOptions
If you look at the Auth0 class  constructor the rest_options parameter is not used.   This means rate limit retries will not be used.

Comments:

Patch:
diff --git a/auth0/v3/management/auth0.py b/auth0/v3/management/auth0.py
index fb6bc90..c28bfcb 100644
--- a/auth0/v3/management/auth0.py
+++ b/auth0/v3/management/auth0.py
@@ -80,7 +80,15 @@ class Auth0(object):
 
             for name, cls in modules.items():
                 cls = asyncify(cls)
-                setattr(self, name, cls(domain=domain, token=token, rest_options=None))
+                setattr(
+                    self,
+                    name,
+                    cls(domain=domain, token=token, rest_options=rest_options),
+                )
         else:
             for name, cls in modules.items():
-                setattr(self, name, cls(domain=domain, token=token, rest_options=None))
+                setattr(
+                    self,
+                    name,
+                    cls(domain=domain, token=token, rest_options=rest_options),
+                )


Test patch:
diff --git a/auth0/v3/test/management/test_auth0.py b/auth0/v3/test/management/test_auth0.py
index ea2d618..15ce786 100644
--- a/auth0/v3/test/management/test_auth0.py
+++ b/auth0/v3/test/management/test_auth0.py
@@ -29,6 +29,7 @@ from ...management.tickets import Tickets
 from ...management.user_blocks import UserBlocks
 from ...management.users import Users
 from ...management.users_by_email import UsersByEmail
+from ...rest import RestClientOptions
 
 
 class TestAuth0(unittest.TestCase):
@@ -120,3 +121,8 @@ class TestAuth0(unittest.TestCase):
 
     def test_users(self):
         self.assertIsInstance(self.a0.users, Users)
+
+    def test_args(self):
+        rest_options = RestClientOptions(retries=99)
+        auth0 = Auth0(self.domain, self.token, rest_options=rest_options)
+        self.assertEqual(auth0.users.client.options.retries, 99)
Repository: awisu2/imagenatepy

Issue:
unittest
<!-- Edit the body of your new issue then click the ✓ "Create Issue" button in the top right of the editor. The first line will be the issue title. Assignees and Labels follow after a blank line. Leave an empty line before beginning the body of the issue. -->

Comments:

Patch:
diff --git a/setup.cfg b/setup.cfg
index 581b2a7..e469e17 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -36,6 +36,9 @@ package_dir =
 # entry_pointの設定を外部ファイルにする場合
 # entry_points = file: entry_points.cfg
 
+# テストモジュールのあるディレクトリ
+test_suite=tests
+
 # options.packages = find: の引数
 [options.packages.find]
 where=src
diff --git a/src/imagenate/sample.py b/src/imagenate/sample.py
index 5d0fbb8..d58c878 100644
--- a/src/imagenate/sample.py
+++ b/src/imagenate/sample.py
@@ -1,2 +1,2 @@
 def hello():
-    print('hello')
\ No newline at end of file
+    return "hello"


Test patch:
diff --git a/src/tests/__init__.py b/src/tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/src/tests/test_imagenate.py b/src/tests/test_imagenate.py
new file mode 100644
index 0000000..108890b
--- /dev/null
+++ b/src/tests/test_imagenate.py
@@ -0,0 +1,7 @@
+import unittest
+import imagenate
+
+class TestImagenate(unittest.TestCase):
+
+    def test_hello(self):
+        self.assertEqual(imagenate.hello(), 'hello', 'hello is misssing')