nebius/SWE-bench-extra huggingface dataset:
Repository: kecorbin/virlutils

Issue:
need error handling on `virl pull`
## Example

This workflow should provide an error back to the user

```
[root@localhost test2]# virl pull foo
Pulling from foo
Saved topology as topology.virl
You have new mail in /var/spool/mail/root
[root@localhost test2]# cat topology.virl 
400: Invalid request
```

Comments:

Patch:
diff --git a/virl/cli/pull/commands.py b/virl/cli/pull/commands.py
index debc4c6..99c5423 100644
--- a/virl/cli/pull/commands.py
+++ b/virl/cli/pull/commands.py
@@ -12,7 +12,10 @@ def pull(repo, **kwargs):
     url = "https://raw.githubusercontent.com/"
     url = url + "{}/master/topology.virl".format(repo)
     resp = requests.get(url)
-
-    with open('topology.virl', 'w') as fh:
-        fh.write(resp.text)
-    click.secho("Saved topology as topology.virl", fg="green")
+    if resp.ok:
+        with open('topology.virl', 'w') as fh:
+            fh.write(resp.text)
+        click.secho("Saved topology as topology.virl", fg="green")
+    else:
+        click.secho("Error pulling {} - repo not found".format(repo),
+                    fg="red")


Test patch:
diff --git a/tests/pull.py b/tests/pull.py
index 05c8204..2f060be 100644
--- a/tests/pull.py
+++ b/tests/pull.py
@@ -17,3 +17,16 @@ class Tests(BaseTest):
             runner = CliRunner()
             result = runner.invoke(virl, ["pull", "foo/bar"])
             self.assertEqual(0, result.exit_code)
+
+    def test_virl_pull_invalid_repo(self):
+        with requests_mock.mock() as m:
+            # Mock the request to return what we expect from the API.
+
+            topo_url = 'https://raw.githubusercontent.com/'
+            topo_url += 'doesnt/exist/master/topology.virl'
+            m.get(topo_url, status_code=400)
+            runner = CliRunner()
+            result = runner.invoke(virl, ["pull", "doesnt/exist"])
+            expected = "Pulling from doesnt/exist\nError pulling " \
+                       "doesnt/exist - repo not found\n"
+            self.assertEqual(result.output, expected)
Repository: kerrickstaley/genanki

Issue:
HTML tags are not case sensitive
`_INVALID_HTML_TAG_RE` is case sensitive, so I'm getting false positive warnings on tags like `<TABLE>, `<TD>`, etc.

Comments:

Patch:
diff --git a/genanki/note.py b/genanki/note.py
index 0ffcd98..42609be 100644
--- a/genanki/note.py
+++ b/genanki/note.py
@@ -47,7 +47,7 @@ class _TagList(list):
 
 
 class Note:
-  _INVALID_HTML_TAG_RE = re.compile(r'<(?!/?[a-z0-9]+(?: .*|/?)>)(?:.|\n)*?>')
+  _INVALID_HTML_TAG_RE = re.compile(r'<(?!/?[a-zA-Z0-9]+(?: .*|/?)>)(?:.|\n)*?>')
 
   def __init__(self, model=None, fields=None, sort_field=None, tags=None, guid=None, due=0):
     self.model = model


Test patch:
diff --git a/tests/test_note.py b/tests/test_note.py
index ede19f3..f654e30 100644
--- a/tests/test_note.py
+++ b/tests/test_note.py
@@ -172,6 +172,9 @@ class TestFindInvalidHtmlTagsInField:
 
   def test_ok_attrs(self):
     assert genanki.Note._find_invalid_html_tags_in_field('<h1 style="color: red">STOP</h1>') == []
+    
+  def test_ok_uppercase(self):
+    assert genanki.Note._find_invalid_html_tags_in_field('<TD></Td>') == []
 
   def test_ng_empty(self):
     assert genanki.Note._find_invalid_html_tags_in_field(' hello <> goodbye') == ['<>']
Repository: kidosoft/Morelia

Issue:
initial step matching is done with non-augmented predicates when show_all_missing=True
* Morelia version: 0.7.1
* Python version: 2.7

### Description

`show_all_missing=True` does an initial matching pass where the `augmented_predicate` is not augmented yet

this prevents using a regex like `(\d+)` to match steps which have numeric variable substitutions because the regex needs to match `<variable_name>` instead

if I set `show_all_missing=False` then I can regex match on augmented predicates like I wanted

Comments:

Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index b0066c2..e8bd1aa 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -10,6 +10,10 @@ and this project adheres to `Semantic Versioning <http://semver.org/>`_.
 Version: Unreleased
 ===============================================================================
 
+FIXED
+-----
+
+  * matching steps with augmented predicate (#123)
 
 Version: 0.7.1 (2019-01-15)
 ===============================================================================
diff --git a/morelia/visitors.py b/morelia/visitors.py
index 8d25552..c55b9c9 100644
--- a/morelia/visitors.py
+++ b/morelia/visitors.py
@@ -184,3 +184,6 @@ class StepMatcherVisitor(IVisitor):
         if suggest:
             diagnostic = u'Cannot match steps:\n\n{}'.format(suggest)
             self._suite.fail(to_docstring(diagnostic))
+
+    def permute_schedule(self, node):
+        return node.permute_schedule()


Test patch:
diff --git a/example/test_acceptance.py b/example/test_acceptance.py
index dbf8272..3131e82 100644
--- a/example/test_acceptance.py
+++ b/example/test_acceptance.py
@@ -31,7 +31,7 @@ class CalculatorTestCase(unittest.TestCase):
         self.calculator.on()
 
     def step_I_enter_a_number_into_the_calculator(self, number):
-        r'I enter "(.+)" into the calculator'  # match by regexp
+        r'I enter "(\d+)" into the calculator'  # match by regexp
         self.calculator.push(int(number))
 
     def step_I_press_add(self):  # matched by method name
Repository: kinegratii/borax

Issue:
农历:LunarDate.cn_day_calendar 计算错误%F 描述符缺少“月”后缀
## 问题类型

- [X] BUG
- [ ] 新功能
- [ ] 功能优化

## 问题

LunarDate.cn_day_calendar 计算错误，同时 '%F' 描述符计算错误。


## 代码

```python
from borax.calendars import LunarDate, LCalendars
print([LunarDate(year=2017, month=month, day=1, leap=leap).cn_day_calendar for month, days, leap in LCalendars.iter_year_month(2017)])
```

结果为

```
['正', '二', '三', '四', '五', '六', '六', '七', '八', '九', '十', '冬', '腊']
```

正确结果为

```

```
['正月', '二月', '三月', '四月', '五月', '六月', '闰六', '七月', '八月', '九月', '十月', '冬月', '腊月']
```
```


Comments:

Patch:
diff --git a/borax/calendars/lunardate.py b/borax/calendars/lunardate.py
index 1ff9b59..b7adda7 100644
--- a/borax/calendars/lunardate.py
+++ b/borax/calendars/lunardate.py
@@ -456,7 +456,10 @@ class LunarDate(EncoderMixin):
     @property
     def cn_day_calendar(self) -> str:
         if self.day == 1:
-            return self.cn_month
+            if self.leap:
+                return '闰{}'.format(self.cn_month)
+            else:
+                return '{}月'.format(self.cn_month)
         else:
             return self.cn_day
 


Test patch:
diff --git a/tests/test_lunardate.py b/tests/test_lunardate.py
index 3d1d7a1..86417c7 100644
--- a/tests/test_lunardate.py
+++ b/tests/test_lunardate.py
@@ -127,6 +127,7 @@ class FormatterTestCase(unittest.TestCase):
         ld2 = LunarDate(2018, 11, 23)
         self.assertEqual('二〇一八/冬/廿三', ld2.strftime('%Y/%M/%D'))
         self.assertEqual('二〇一八/十一/廿三', ld2.strftime('%Y/%N/%D'))
+        self.assertEqual('廿三', ld2.strftime('%F'))
 
         ld3 = LunarDate(2017, 6, 3, 1)
         self.assertEqual('61', ld3.strftime('%m%l'))
@@ -143,6 +144,12 @@ class FormatterTestCase(unittest.TestCase):
         ld = LunarDate(2020, 3, 23)
         self.assertEqual('tem:-', ld.strftime('tem:%t'))
 
+    def test_cn_calendar_day(self):
+        ld = LunarDate(2017, 6, 1, 1)
+        self.assertEqual('闰六', ld.strftime('%F'))
+        ld1 = LunarDate(2017, 11, 1, 0)
+        self.assertEqual('冬月', ld1.strftime('%F'))
+
 
 class LCalendarTestCase(unittest.TestCase):
     def test_ndays(self):
Repository: kinegratii/borax

Issue:
农历日“二十”“三十”中文名称错误
## 发现版本

v3.4.0

## 问题描述

“廿十”、“卅十” 是不正确的用法，因为“廿”、“卅” 本身就是二十、三十的意思了，正确的应该为“二十”、“三十”。


## 代码示例

```python
from borax.calendars.lunardate import LunarDate, TextUtils

print(TextUtils.day_cn(20)) # “廿十”
ld = LunarDate(2020, 10, 20, 0)
print(ld.cn_day) # “廿十”
print(ld.cn_day_calendar) # “廿十”
print(ld.cn_str()) # “廿十”
```

## 建议方案

只需要修改 `TextUtils.day_cn` 逻辑即可，其他函数均是调用该函数。


Comments:

Patch:
diff --git a/borax/calendars/lunardate.py b/borax/calendars/lunardate.py
index b7adda7..6e37c33 100644
--- a/borax/calendars/lunardate.py
+++ b/borax/calendars/lunardate.py
@@ -352,9 +352,10 @@ class TextUtils:
     def day_cn(day: int) -> str:
         a, b = divmod(day, 10)
         if b == 0:  # 10,20,30
-            b = 10
-            if a == 1:  # 10
-                a = 0
+            if a == 1:
+                return TextUtils.TENS[0] + TextUtils.DAYS_CN[10]
+            else:
+                return TextUtils.DAYS_CN[a] + TextUtils.DAYS_CN[10]
         return TextUtils.TENS[a] + TextUtils.DAYS_CN[b]
 
     @staticmethod


Test patch:
diff --git a/tests/test_lunardate.py b/tests/test_lunardate.py
index 86417c7..092c2c9 100644
--- a/tests/test_lunardate.py
+++ b/tests/test_lunardate.py
@@ -4,7 +4,22 @@ import datetime
 import unittest
 from datetime import date, timedelta
 
-from borax.calendars.lunardate import LunarDate, parse_year_days, LCalendars, InvalidLunarDateError
+from borax.calendars.lunardate import LunarDate, parse_year_days, LCalendars, InvalidLunarDateError, TextUtils
+
+
+class TextUtilsTestCase(unittest.TestCase):
+    def test_cn_day_text(self):
+        data = [
+            (1, '初一'),
+            (10, '初十'),
+            (14, '十四'),
+            (20, '二十'),
+            (23, '廿三'),
+            (30, '三十')
+        ]
+        for value, text in data:
+            with self.subTest(value=value, text=text):
+                self.assertEqual(text, TextUtils.day_cn(value))
 
 
 class LunarDateTestCase(unittest.TestCase):