nebius/SWE-bench-extra huggingface dataset:
Repository: bugsnag/bugsnag-python

Issue:
DeprecationWarning: The Event "metadata" argument has been replaced with "metadata" - Typo
<!-- Before raising, please check if somebody else has already reported your issue. -->

### Describe the bug
typo in Depercation warning

it should be `DeprecationWarning: The Event "meta_data" argument has been replaced with "metadata"`

### Steps to reproduce
![image](https://user-images.githubusercontent.com/7542220/173654706-7c45988e-5aed-49d0-b996-a0db0fc8fa8d.png)


### Environment
* Bugsnag version: 4.2.1
* Python version: 3.9.13
* Integration framework version:
    * ASGI: Daphne
    * Celery: 5.2
    * Django: 4.0



Comments:

Patch:
diff --git a/bugsnag/event.py b/bugsnag/event.py
index a06cae3..1b18a9d 100644
--- a/bugsnag/event.py
+++ b/bugsnag/event.py
@@ -113,7 +113,7 @@ class Event:
 
         self.metadata = {}  # type: Dict[str, Dict[str, Any]]
         if 'meta_data' in options:
-            warnings.warn('The Event "metadata" argument has been replaced ' +
+            warnings.warn('The Event "meta_data" argument has been replaced ' +
                           'with "metadata"', DeprecationWarning)
             for name, tab in options.pop("meta_data").items():
                 self.add_tab(name, tab)
@@ -126,8 +126,8 @@ class Event:
 
     @property
     def meta_data(self) -> Dict[str, Dict[str, Any]]:
-        warnings.warn('The Event "metadata" property has been replaced ' +
-                      'with "meta_data".', DeprecationWarning)
+        warnings.warn('The Event "meta_data" property has been replaced ' +
+                      'with "metadata".', DeprecationWarning)
         return self.metadata
 
     @property


Test patch:
diff --git a/tests/test_event.py b/tests/test_event.py
index a5d91b3..7eda818 100644
--- a/tests/test_event.py
+++ b/tests/test_event.py
@@ -358,7 +358,7 @@ class TestEvent(unittest.TestCase):
 
             assert len(records) > 0
             i = len(records) - 1
-            assert str(records[i].message) == ('The Event "metadata" ' +
+            assert str(records[i].message) == ('The Event "meta_data" ' +
                                                'argument has been replaced ' +
                                                'with "metadata"')
             assert event.metadata['nuts']['almonds']
diff --git a/tests/test_notify.py b/tests/test_notify.py
index fc445b0..00c918e 100644
--- a/tests/test_notify.py
+++ b/tests/test_notify.py
@@ -843,7 +843,7 @@ class TestBugsnag(IntegrationTest):
                            meta_data={'fruit': {'apples': 2}})
 
             assert len(records) == 1
-            assert str(records[0].message) == ('The Event "metadata" ' +
+            assert str(records[0].message) == ('The Event "meta_data" ' +
                                                'argument has been replaced ' +
                                                'with "metadata"')
Repository: caleb531/automata

Issue:
problems with GNFA.to_regex
GNFA.to_regex seems to give wrong results sometimes. For example, the following code:
```
from automata.fa.dfa import DFA
from automata.fa.nfa import NFA
from automata.fa.gnfa import GNFA

nfa = NFA.from_regex('a*')
dfa = DFA.from_nfa(nfa)
gnfa = GNFA.from_dfa(dfa)
print(gnfa.to_regex())
```
prints a single-character string `*`, which is not a valid regex. 


Comments:

Patch:
diff --git a/automata/base/utils.py b/automata/base/utils.py
index 07611a8..98c8706 100644
--- a/automata/base/utils.py
+++ b/automata/base/utils.py
@@ -81,7 +81,7 @@ def refine(self, S):
         Not a generator because we need to perform the partition
         even if the caller doesn't iterate through the results.
         """
-        hit = defaultdict(lambda: set())
+        hit = defaultdict(set)
         output = []
 
         for x in S:
diff --git a/automata/fa/gnfa.py b/automata/fa/gnfa.py
index b3f3363..e74a027 100644
--- a/automata/fa/gnfa.py
+++ b/automata/fa/gnfa.py
@@ -228,7 +228,7 @@ def to_regex(self):
                     if r2 is None:
                         r2 = ''
                     elif len(r2) == 1:
-                        r2 = f'{r1}*'
+                        r2 = f'{r2}*'
                     else:
                         r2 = f'({r2})*'
 


Test patch:
diff --git a/tests/test_gnfa.py b/tests/test_gnfa.py
index bdb5ef3..63083f8 100644
--- a/tests/test_gnfa.py
+++ b/tests/test_gnfa.py
@@ -345,16 +345,28 @@ def test_to_regex(self):
         then generate NFA from regex (already tested method)
         and check for equivalence of NFA and previous DFA
         """
-
-        nfa = NFA.from_regex('a(aaa*bbcd|abbcd)d*|aa*bb(dcc*|(d|c)b|a?bb(dcc*|(d|c)))ab(c|d)*(ccd)?')
-        gnfa = GNFA.from_nfa(nfa)
-        regex = gnfa.to_regex()
-        nfa = NFA.from_regex(regex)
-        dfa2 = DFA.from_nfa(nfa)
-
-        dfa = DFA.from_nfa(nfa)
-
-        self.assertEqual(dfa, dfa2)
+        regex_strings = [
+            'a*',
+            'aa*b|bba*|(cc*)(bb+)',
+            'a(aaa*bbcd|abbcd)d*|aa*bb(dcc*|(d|c)b|a?bb(dcc*|(d|c)))ab(c|d)*(ccd)?'
+        ]
+
+        for regex_str in regex_strings:
+            nfa_1 = NFA.from_regex(regex_str)
+            gnfa_1 = GNFA.from_nfa(nfa_1)
+            regex_1 = gnfa_1.to_regex()
+            nfa_2 = NFA.from_regex(regex_1)
+
+            # Test equality under NFA regex conversion
+            self.assertEqual(nfa_1, nfa_2)
+
+            dfa_1 = DFA.from_nfa(nfa_1)
+            gnfa_2 = GNFA.from_dfa(dfa_1)
+            regex_2 = gnfa_2.to_regex()
+            dfa_2 = DFA.from_nfa(NFA.from_regex(regex_2))
+
+            # Test equality through DFA regex conversion
+            self.assertEqual(dfa_1, dfa_2)
 
     def test_read_input_step_not_implemented(self):
         """Should not implement read_input_stepwise() for GNFA."""