nebius/SWE-bench-extra huggingface dataset:
Repository: bpython/bpython

Issue:
Option-delete doesn't delete a left paren
On line like
~~~
>>> (( asdf a sdf
>>>         lots of space
~~~
pressing option-delete repeatedly doesn't delete the opening parens or leading spaces

Comments:

Patch:
diff --git a/bpython/curtsiesfrontend/manual_readline.py b/bpython/curtsiesfrontend/manual_readline.py
index 35d28f54..223ec9e7 100644
--- a/bpython/curtsiesfrontend/manual_readline.py
+++ b/bpython/curtsiesfrontend/manual_readline.py
@@ -323,7 +323,7 @@ def titlecase_next_word(cursor_offset, line):
     return cursor_offset, line  # TODO Not implemented
 
 
-delete_word_from_cursor_back_re = LazyReCompile(r'\b\w')
+delete_word_from_cursor_back_re = LazyReCompile(r'^|\b\w')
 
 
 @edit_keys.on('<Esc+BACKSPACE>')


Test patch:
diff --git a/bpython/test/test_manual_readline.py b/bpython/test/test_manual_readline.py
index 4141292d..faf4b585 100644
--- a/bpython/test/test_manual_readline.py
+++ b/bpython/test/test_manual_readline.py
@@ -240,6 +240,12 @@ class TestManualReadline(unittest.TestCase):
             "|"],
             delete_word_from_cursor_back)
 
+        self.try_stages_kill([
+            " (( asdf |",
+            " (( |",
+            "|"],
+            delete_word_from_cursor_back)
+
 
 class TestEdits(unittest.TestCase):
Repository: bradleygolden/pytailor

Issue:
Rename watch_env_var
watch_env_var is confusingly named. It should be called something like "from_env_var"

For example
```
config.watch_env_var("FOO")
```

could be something like:
```
config.from_environ("FOO")
# or
config.from_env_var("FOO")
# or
config.from_envar("FOO")
```

or perhaps we can get more creative with something like:
```
config.environ["FOO"]
config.environ.get("FOO")
```

Where environ is a dictionary like object that takes brackets or the .get() method.

Comments:

Patch:
diff --git a/pytailor/__version__.py b/pytailor/__version__.py
index 57f0c12..8ed71d5 100644
--- a/pytailor/__version__.py
+++ b/pytailor/__version__.py
@@ -7,6 +7,6 @@
 # |__|   \/                \/
 
 
-VERSION = (0, 1, 4)
+VERSION = (0, 1, 5)
 
 __version__ = ".".join(map(str, VERSION))
diff --git a/pytailor/tailor.py b/pytailor/tailor.py
index 5ee150b..e9675e7 100644
--- a/pytailor/tailor.py
+++ b/pytailor/tailor.py
@@ -46,8 +46,8 @@ class Tailor(dict):
         for name, value in _store.items():
             self[name] = value
 
-    def watch_env_var(self, name: str):
-        """Set configuration and watch a system wide environment variable."""
+    def from_envar(self, name: str):
+        """Set configuration from an environment variable."""
         value = os.getenv(name)
         if not value:
             warn_msg = f"Environment variable '{name}' not found."


Test patch:
diff --git a/tests/test_tailor.py b/tests/test_tailor.py
index db3c231..f2fbdae 100644
--- a/tests/test_tailor.py
+++ b/tests/test_tailor.py
@@ -49,26 +49,26 @@ def test_from_object_and_then_dotenv(env_path):
     assert config["TESTING"] is False
 
 
-def test_watch_env_var_that_doesnt_exist_raises_warning():
+def test_from_envar_that_doesnt_exist_raises_warning():
     config = Tailor()
     with pytest.warns(RuntimeWarning) as warn:
-        config.watch_env_var("BAR")
+        config.from_envar("BAR")
 
     assert len(warn) == 1
     assert "not found" in warn[0].message.args[0]
 
 
-def test_watch_env_var_that_doesnt_exist_but_exists_in_config_object():
+def test_from_envar_that_doesnt_exist_but_exists_in_config_object():
     config = Tailor()
     config["BAR"] = "BAZ"
-    config.watch_env_var("BAR")
+    config.from_envar("BAR")
     assert "BAR" in config
     assert config["BAR"] == "BAZ"
 
 
-def test_watch_env_var_and_change_after_watching():
+def test_from_envar_and_change_after_watching():
     config = Tailor()
-    config.watch_env_var("FOO")
+    config.from_envar("FOO")
     assert config["FOO"] == "BAR"
     os.environ["FOO"] = "BAZ"
     assert config["FOO"] == "BAZ"
@@ -76,7 +76,7 @@ def test_watch_env_var_and_change_after_watching():
 
 def test_env_var_is_set_then_gets_removed():
     config = Tailor()
-    config.watch_env_var("FOO")
+    config.from_envar("FOO")
     del os.environ["FOO"]
     # check original value was backed up
     assert config["FOO"] == "BAR"
Repository: brandon-rhodes/python-sgp4

Issue:
export_tle roundtrip issues
While studying #70, I discovered a roundtrip problem with `export_tle`:

```
>>> lines = """1 46272U 20061A   20311.82207422  .00000083  00000-0  68546-5 0  9999
... 2 46272  97.3995  23.7575 0006827 352.5560   7.5569 15.20743438  9810"""
>>> print(lines)
1 46272U 20061A   20311.82207422  .00000083  00000-0  68546-5 0  9999
2 46272  97.3995  23.7575 0006827 352.5560   7.5569 15.20743438  9810
>>> sat = twoline2rv(*lines.splitlines(), wgs84)
>>> print("\n".join(export_tle(sat)))
1 46272U 20061A   2020311.82207422  .00000083  00000-0  68546-5 0  9993
2 46272  97.3995  23.7575 0006827 352.5560   7.5569 15.20743438  9810
```

And I think it also happens with other examples in https://github.com/brandon-rhodes/python-sgp4/blob/master/sgp4/SGP4-VER.TLE.

Comments:

Patch:
diff --git a/sgp4/exporter.py b/sgp4/exporter.py
index 759c034..32d6baf 100644
--- a/sgp4/exporter.py
+++ b/sgp4/exporter.py
@@ -30,7 +30,10 @@ def export_tle(satrec):
     append(satrec.intldesg.ljust(8, " ") + " ")
 
     # Add epoch year and days in YYDDD.DDDDDDDD format
-    append(str(satrec.epochyr).zfill(2) + "{:012.8f}".format(satrec.epochdays) + " ")
+    epochyr = satrec.epochyr
+    # Undo non-standard 4-digit year for old satrec objects
+    epochyr %= 100
+    append(str(epochyr).zfill(2) + "{:012.8f}".format(satrec.epochdays) + " ")
 
     # Add First Time Derivative of the Mean Motion (don't use "+")
     append("{0: 8.8f}".format(satrec.ndot * (_xpdotp * 1440.0)).replace("0", "", 1) + " ")


Test patch:
diff --git a/sgp4/tests.py b/sgp4/tests.py
index ba63b1d..3fb6d41 100644
--- a/sgp4/tests.py
+++ b/sgp4/tests.py
@@ -198,14 +198,18 @@ def test_tle_export():
         line1 = line1[:69]
         line2 = line2[:69]
         satrec = Satrec.twoline2rv(line1, line2)
+        satrec_old = io.twoline2rv(line1, line2, wgs72)
 
         # Generate TLE from satrec
         out_line1, out_line2 = export_tle(satrec)
+        out_line1_old, out_line2_old = export_tle(satrec_old)
 
         if satrec.satnum not in expected_errs_line1:
             assertEqual(out_line1, line1)
+            assertEqual(out_line1_old, line1)
         if satrec.satnum not in expected_errs_line2:
             assertEqual(out_line2, line2)
+            assertEqual(out_line2_old, line2)
 
 def test_export_tle_raises_error_for_out_of_range_angles():
     # See https://github.com/brandon-rhodes/python-sgp4/issues/70