nebius/SWE-bench-extra huggingface dataset:
Repository: enowars/enochecker

Issue:
Deprecate self.round or self.current_round
I'm not sure which one to keep, but I would replace the other one with:

```
@property
def current_round(self):
    raise DeprecationWarning(...)
    return self.round
```

Comments:

Patch:
diff --git a/src/enochecker/enochecker.py b/src/enochecker/enochecker.py
index fc8dbbc..976688e 100644
--- a/src/enochecker/enochecker.py
+++ b/src/enochecker/enochecker.py
@@ -287,7 +287,6 @@ class BaseChecker(metaclass=_CheckerMeta):
             )
             round_id = round_id or round
         self.round: Optional[int] = round_id
-        self.current_round: Optional[int] = round_id
         self.flag_round: Optional[int] = flag_round
         self.round_length: int = round_length
         self.flag: Optional[str] = flag
@@ -359,6 +358,18 @@ class BaseChecker(metaclass=_CheckerMeta):
         self.error: Callable[..., None] = self.logger.error
         self.critical: Callable[..., None] = self.logger.critical
 
+    @property
+    def current_round(self) -> Optional[int]:
+        """
+        Deprecated! Only for backwards compatibility! Use self.round instead.
+
+        :return: current round
+        """
+        warnings.warn(
+            "current_round is deprecated, use round instead", DeprecationWarning
+        )
+        return self.round
+
     @property
     def noise(self) -> Optional[str]:
         """


Test patch:
diff --git a/tests/test_enochecker.py b/tests/test_enochecker.py
index 948b888..91009c1 100644
--- a/tests/test_enochecker.py
+++ b/tests/test_enochecker.py
@@ -267,6 +267,13 @@ def test_checker():
 
     assert CheckerExampleImpl(method="havoc").run().result == Result.OFFLINE
 
+    c = CheckerExampleImpl(method="putflag", round_id=1337)
+    with pytest.deprecated_call():
+        assert c.current_round == 1337
+    c.round = 15
+    with pytest.deprecated_call():
+        assert c.current_round == c.round
+
 
 @temp_storage_dir
 def test_useragents():
Repository: espdev/csaps

Issue:
results of UnivariateCubicSmoothingSpline for smooth = 0
@espdev Thank you for writing this library. it is awesome and very useful. I noticed that when I use UnivariateCubicSmoothingSpline with smooth = 0,  I don't get a straight line, instead, it does "auto smooth".

using the example you gave with smooth = 0 I get:
![image](https://user-images.githubusercontent.com/32917209/58765859-1e01cb00-852c-11e9-914d-ef9cb454ebfe.png)

what I expected to get is the following:
![image](https://user-images.githubusercontent.com/32917209/58765836-e3982e00-852b-11e9-9f22-7e2c0ea624ca.png)

I believe the root cause for this is that the following if statement in the code would be false for  self._smooth = 0:
`if self._smooth:`
`                p = self._smooth`
` else:`
`                 p = self._compute_smooth(r, qtwq)`

proposed correction:
`if (self._smooth or self._smooth==0):`
`                p = self._smooth`
` else:`
`                 p = self._compute_smooth(r, qtwq)`



Comments:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..d405cbf
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# v0.4.2
+
+* FIX: "smooth" value is 0.0 was not used
+
+# v0.4.1
+
+* First PyPI release
diff --git a/csaps.py b/csaps.py
index c838584..e5d82e2 100644
--- a/csaps.py
+++ b/csaps.py
@@ -281,10 +281,10 @@ class UnivariateCubicSmoothingSpline:
             # Solve linear system for the 2nd derivatives
             qtwq = qtw @ qtw.T
 
-            if self._smooth:
-                p = self._smooth
-            else:
+            if self._smooth is None:
                 p = self._compute_smooth(r, qtwq)
+            else:
+                p = self._smooth
 
             a = (6. * (1. - p)) * qtwq + p * r
             b = np.diff(divdydx, axis=self._axis).T
diff --git a/setup.py b/setup.py
index 34d524a..b2f82e4 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup
 
 
 NAME = 'csaps'
-VERSION = '0.4.1'
+VERSION = '0.4.2'
 ROOT_DIR = pathlib.Path(__file__).parent
 
 


Test patch:
diff --git a/tests/test_csaps.py b/tests/test_csaps.py
index 61172dc..7eb3260 100644
--- a/tests/test_csaps.py
+++ b/tests/test_csaps.py
@@ -252,5 +252,21 @@ def test_surface_smoothing():
     _ = sp(xdata)
 
 
+def test_zero_smooth():
+    x = [1., 2., 4., 6.]
+    y = [2., 4., 5., 7.]
+
+    sp = csaps.UnivariateCubicSmoothingSpline(x, y, smooth=0.)
+
+    assert sp.smooth == pytest.approx(0.)
+
+    ys = sp(x)
+
+    assert ys == pytest.approx([2.440677966101695,
+                                3.355932203389830,
+                                5.186440677966102,
+                                7.016949152542373])
+
+
 if __name__ == '__main__':
     pytest.main()
Repository: ethereum/eth-utils

Issue:
Update `is_address` logic
For less confusion, `is_address` should have less strict of a check on checksums. See conversation [here](https://github.com/ethereum/web3.py/issues/715).

Comments:

Patch:
diff --git a/eth_utils/address.py b/eth_utils/address.py
index df77241..3407e70 100644
--- a/eth_utils/address.py
+++ b/eth_utils/address.py
@@ -59,12 +59,7 @@ def is_address(value: Any) -> bool:
     """
     Is the given string an address in any of the known formats?
     """
-    if is_hex_address(value):
-        if _is_checksum_formatted(value):
-            return is_checksum_address(value)
-        return True
-
-    if is_binary_address(value):
+    if is_hex_address(value) or is_binary_address(value):
         return True
 
     return False
diff --git a/newsfragments/265.breaking.rst b/newsfragments/265.breaking.rst
new file mode 100644
index 0000000..a1f708c
--- /dev/null
+++ b/newsfragments/265.breaking.rst
@@ -0,0 +1,1 @@
+`Web3.is_address` now returns True for non-checksummed addresses.


Test patch:
diff --git a/tests/address-utils/test_address_utils.py b/tests/address-utils/test_address_utils.py
index fb8d852..56f4f64 100644
--- a/tests/address-utils/test_address_utils.py
+++ b/tests/address-utils/test_address_utils.py
@@ -35,8 +35,8 @@ from eth_utils.address import (
         # checksummed - valid
         ("0x5B2063246F2191f18F2675ceDB8b28102e957458", True, True, False),
         (b"0x5B2063246F2191f18F2675ceDB8b28102e957458", False, False, False),
+        ("0x5b2063246F2191f18F2675ceDB8b28102e957458", True, True, False),
         # checksummed - invalid
-        ("0x5b2063246F2191f18F2675ceDB8b28102e957458", False, True, False),
         (b"0x5b2063246F2191f18F2675ceDB8b28102e957458", False, False, False),
         # too short - unprefixed
         ("c6d9d2cd449a754c494264e1809c50e34d64562", False, False, False),
Repository: ethereum/py_ecc

Issue:
secp256k1.py fails on Python 3.4
Error test:

```python
import binascii
import rlp
# sha3 from module `pysha3` not `ssh3`
import sha3
from py_ecc.secp256k1 import ecdsa_raw_recover

n = 0
p = 20000000000
g = 100000
v = 1000
Tn = ''
Tp = p.to_bytes((p.bit_length()//8) + 1,byteorder='big')
Tg = g.to_bytes((g.bit_length()//8) + 1,byteorder='big')
Tt = binascii.unhexlify("687422eEA2cB73B5d3e242bA5456b782919AFc85")
Tv = v.to_bytes((v.bit_length()//8) + 1,byteorder='big')
Td = binascii.unhexlify("c0de")
transaction = [Tn, Tp, Tg, Tt, Tv, Td]
rlp_data=rlp.encode(transaction)
unsigned_message=sha3.keccak_256(rlp_data).hexdigest()
v = 28
r = int("5897c2c7c7412b0a555fb6f053ddb6047c59666bbebc6f5573134e074992d841",16)
s = int("1c71d1c62b74caff8695a186e2a24dd701070ba9946748318135e3ac0950b1d4",16)
ecdsa_raw_recover(unsigned_message, (v, r, s))
```

Error message:

> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/apalau/python3.4/lib64/python3.4/site-packages/py_ecc/secp256k1/secp256k1.py", line 132, in ecdsa_raw_recover
    z = bytes_to_int(msghash)
  File "/home/apalau/python3.4/lib64/python3.4/site-packages/py_ecc/secp256k1/secp256k1.py", line 21, in bytes_to_int
    o = (o << 8) + safe_ord(b)
TypeError: unsupported operand type(s) for +: 'int' and 'str'

On Python 2.7 the same `ecdsa_raw_recover(unsigned_message, (v, r, s))` works well.

Python version:

> python --version
> Python 3.4.5


Comments:

Patch:
diff --git a/py_ecc/secp256k1/secp256k1.py b/py_ecc/secp256k1/secp256k1.py
index 68f1ca1..db93ee5 100644
--- a/py_ecc/secp256k1/secp256k1.py
+++ b/py_ecc/secp256k1/secp256k1.py
@@ -6,8 +6,11 @@ import sys
 if sys.version_info.major == 2:
     safe_ord = ord
 else:
-    def safe_ord(x):
-        return x
+    def safe_ord(value):
+        if isinstance(value, int):
+            return value
+        else:
+            return ord(value)
 
 
 # Elliptic curve parameters (secp256k1)


Test patch:
diff --git a/tests/test_secp256k1.py b/tests/test_secp256k1.py
index c7fbe23..a56bba1 100644
--- a/tests/test_secp256k1.py
+++ b/tests/test_secp256k1.py
@@ -12,3 +12,11 @@ def test_privtopub():
 def test_ecdsa_raw_sign():
     v, r, s = ecdsa_raw_sign(b'\x35' * 32, priv)
     assert ecdsa_raw_recover(b'\x35' * 32, (v, r, s)) == pub
+
+
+def test_issue_4_bug():
+    unsigned_message = '6a74f15f29c3227c5d1d2e27894da58d417a484ef53bc7aa57ee323b42ded656'
+    v = 28
+    r = int("5897c2c7c7412b0a555fb6f053ddb6047c59666bbebc6f5573134e074992d841", 16)
+    s = int("1c71d1c62b74caff8695a186e2a24dd701070ba9946748318135e3ac0950b1d4", 16)
+    ecdsa_raw_recover(unsigned_message, (v, r, s))
Repository: evansd/whitenoise

Issue:
HTTP 304 being returned when Etag doesn't match
Hi!

Currently WhiteNoise:
* includes both an `Etag` and `Last-Modified` header on all responses
* checks incoming requests to see if they specified a `If-None-Match` (used for Etag) or `If-Modified-Since` header, to determine whether to return an HTTP 304 response

However the current implementation falls back to `If-Modified-Since` even if there was a non-matching `If-None-Match`, rather than returning false:
https://github.com/evansd/whitenoise/blob/1b5a7f3a0f151ee1449d88da9e4813644e435fd4/whitenoise/responders.py#L169-L176

This is problematic since:
* browsers (at least Firefox and Chrome, haven't checked the rest) always send both sets of headers
* `If-Modified-Since` is unreliable in the case of deployment rollbacks (since by design the comparison is greater than or equal to modified time, rather than just equal to)

Demo:

```bash
curl -I https://treeherder.mozilla.org/ \
  -H 'If-None-Match: "this-will-not-match"' \
  -H 'If-Modified-Since: Thu, 25 Oct 2099 16:00:44 GMT'
```

Currently this returns HTTP 304 even though it has a non-matching `If-None-Match` header value.

This caused frontend breakage after a rollback we performed today, which persisted until users force-refreshed:

----

![screenshot_2018-11-12 12 autoland](https://user-images.githubusercontent.com/501702/48365062-b6745300-e6a1-11e8-8dd9-cc37aa00d5d8.png)

Comments:

Patch:
diff --git a/whitenoise/responders.py b/whitenoise/responders.py
index c36c887..debedcc 100644
--- a/whitenoise/responders.py
+++ b/whitenoise/responders.py
@@ -167,8 +167,9 @@ class StaticFile(object):
         return alternatives
 
     def is_not_modified(self, request_headers):
-        if self.etag == request_headers.get('HTTP_IF_NONE_MATCH'):
-            return True
+        previous_etag = request_headers.get('HTTP_IF_NONE_MATCH')
+        if previous_etag is not None:
+            return previous_etag == self.etag
         try:
             last_requested = request_headers['HTTP_IF_MODIFIED_SINCE']
         except KeyError:


Test patch:
diff --git a/tests/test_whitenoise.py b/tests/test_whitenoise.py
index d186cc8..5bf70cd 100644
--- a/tests/test_whitenoise.py
+++ b/tests/test_whitenoise.py
@@ -102,6 +102,18 @@ class WhiteNoiseTest(TestCase):
         response = self.server.get(self.files.js_url, headers={'If-None-Match': etag})
         self.assertEqual(response.status_code, 200)
 
+    def test_etag_overrules_modified_since(self):
+        """
+        Browsers send both headers so it's important that the ETag takes precedence
+        over the last modified time, so that deploy-rollbacks are handled correctly.
+        """
+        headers = {
+            'If-None-Match': '"594bd1d1-36"',
+            'If-Modified-Since': 'Fri, 11 Apr 2100 11:47:06 GMT',
+        }
+        response = self.server.get(self.files.js_url, headers=headers)
+        self.assertEqual(response.status_code, 200)
+
     def test_max_age(self):
         response = self.server.get(self.files.js_url)
         self.assertEqual(response.headers['Cache-Control'], 'max-age=1000, public')
Repository: facelessuser/pymdown-extensions

Issue:
Code block snippet lines render blank code block, when it's just the first line 
### Description

When I embed a snippet in a code snippet, restricting the lines to `:1:1`, the code block is rendered empty. This can temporarily be fixed by writing `::1` (which should be equivalent), so it's not urgent or anything, but I thought, you might want to fix that.

### Minimal Reproduction

1. Create the following code block:
```pony
--8<-- "some-code-snippet-file-path.pony:1:1"
```
2. Build your site and check the result for the code block

### Version(s) & System Info

- Operating System: ¯\\\_(ツ)\_/¯ 
- Python Version: 3.8
- Package Version: 10.8

Comments:

Patch:
diff --git a/docs/src/markdown/about/changelog.md b/docs/src/markdown/about/changelog.md
index 5265ffb0..b617548a 100644
--- a/docs/src/markdown/about/changelog.md
+++ b/docs/src/markdown/about/changelog.md
@@ -1,5 +1,9 @@
 # Changelog
 
+## 10.8.1
+
+-   **FIX**: Snippets: Fix snippet line range with a start of line 1.
+
 ## 10.8
 
 -   **NEW**: Require Python Markdown 3.6+.
diff --git a/pymdownx/__meta__.py b/pymdownx/__meta__.py
index bf2cda00..d58ff9f7 100644
--- a/pymdownx/__meta__.py
+++ b/pymdownx/__meta__.py
@@ -185,5 +185,5 @@ def parse_version(ver, pre=False):
     return Version(major, minor, micro, release, pre, post, dev)
 
 
-__version_info__ = Version(10, 8, 0, "final")
+__version_info__ = Version(10, 8, 1, "final")
 __version__ = __version_info__._get_canonical()
diff --git a/pymdownx/snippets.py b/pymdownx/snippets.py
index dbb1e537..58aada02 100644
--- a/pymdownx/snippets.py
+++ b/pymdownx/snippets.py
@@ -292,7 +292,7 @@ class SnippetPreprocessor(Preprocessor):
                     end = int(ending[1:])
                 starting = m.group(2)
                 if starting and len(starting) > 1:
-                    start = max(1, int(starting[1:]) - 1)
+                    start = max(0, int(starting[1:]) - 1)
                 section_name = m.group(4)
                 if section_name:
                     section = section_name[1:]


Test patch:
diff --git a/tests/test_extensions/test_snippets.py b/tests/test_extensions/test_snippets.py
index 80410345..3a792efb 100644
--- a/tests/test_extensions/test_snippets.py
+++ b/tests/test_extensions/test_snippets.py
@@ -209,6 +209,33 @@ class TestSnippets(util.MdCase):
             True
         )
 
+    def test_start_1_1(self):
+        """Test beginning of file, single line range."""
+
+        self.check_markdown(
+            R'''
+            ---8<--- "lines.txt:1:1"
+            ''',
+            '''
+            <p>This is a multi-line</p>
+            ''',
+            True
+        )
+
+    def test_start_1_2(self):
+        """Test beginning of file span of multiple lines."""
+
+        self.check_markdown(
+            R'''
+            ---8<--- "lines.txt:1:2"
+            ''',
+            '''
+            <p>This is a multi-line
+            snippet.</p>
+            ''',
+            True
+        )
+
     def test_end_line_inline(self):
         """Test ending line with inline syntax."""