PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: ably/ably-python (python)
Issue: `RSN4b`: Error raised
Spec point `RSN4b`:

```
Calling release() with a channel name that does not correspond to an extant channel entity must return without error
```

At the moment, calling release on a non-existent channel results in an error being raised due to it not appearing in the channel map.
Pull request description: RSN4b Compliance
This change does the following:

- Removes the `__delitem__` magic method from the REST `Channels` implementation (as not part of spec)
- Fixes a non-compliance with `RSN4b` - whereby previously calling release on a non-existent channel would result in a KeyError being raised.

Fixes #472 

Patch:
diff --git a/ably/rest/channel.py b/ably/rest/channel.py
index 5ea8efd..45f6cef 100644
--- a/ably/rest/channel.py
+++ b/ably/rest/channel.py
@@ -219,8 +219,19 @@ class Channels:
     def __iter__(self) -> Iterator[str]:
         return iter(self.__all.values())
 
-    def release(self, key):
-        del self.__all[key]
+    # RSN4
+    def release(self, name):
+        """Releases a Channel object, deleting it, and enabling it to be garbage collected.
+        If the channel does not exist, nothing happens.
 
-    def __delitem__(self, key):
-        return self.release(key)
+        It also removes any listeners associated with the channel.
+
+        Parameters
+        ----------
+        name: str
+            Channel name
+        """
+
+        if name not in self.__all:
+            return
+        del self.__all[name]


Test patch:
diff --git a/test/ably/rest/restchannels_test.py b/test/ably/rest/restchannels_test.py
index c6a791f..b567781 100644
--- a/test/ably/rest/restchannels_test.py
+++ b/test/ably/rest/restchannels_test.py
@@ -70,19 +70,11 @@ class TestChannels(BaseAsyncTestCase):
             assert isinstance(channel, Channel)
             assert name == channel.name
 
+    # RSN4a, RSN4b
     def test_channels_release(self):
         self.ably.channels.get('new_channel')
         self.ably.channels.release('new_channel')
-
-        with pytest.raises(KeyError):
-            self.ably.channels.release('new_channel')
-
-    def test_channels_del(self):
-        self.ably.channels.get('new_channel')
-        del self.ably.channels['new_channel']
-
-        with pytest.raises(KeyError):
-            del self.ably.channels['new_channel']
+        self.ably.channels.release('new_channel')
 
     def test_channel_has_presence(self):
         channel = self.ably.channels.get('new_channnel')
Repository: kayak/pypika (python)
Issue: Alias for Criterions
Criterion expressions cannot be given an alias due to missing .as_ function
Pull request description: Fixes #22 Changed Criterion to extend Term
Extended Term to provide the missing functions on Criterion.

Patch:
diff --git a/pypika/terms.py b/pypika/terms.py
index 47043a3..eba423a 100644
--- a/pypika/terms.py
+++ b/pypika/terms.py
@@ -263,7 +263,7 @@ class ListField(object):
         )
 
 
-class Criterion(object):
+class Criterion(Term):
     def __and__(self, other):
         return ComplexCriterion(Boolean.and_, self, other)
 


Test patch:
diff --git a/pypika/tests/test_criterions.py b/pypika/tests/test_criterions.py
index 782526b..12001de 100644
--- a/pypika/tests/test_criterions.py
+++ b/pypika/tests/test_criterions.py
@@ -12,6 +12,11 @@ __email__ = "theys@kayak.com"
 class CriterionTests(unittest.TestCase):
     t = Table('test', alias = 'crit')
 
+    def test__criterion_with_alias(self):
+        c1 = (Field('foo') == Field('bar')).as_('criterion')
+
+        self.assertEqual('"foo"="bar"', str(c1))
+
     def test__criterion_eq_number(self):
         c1 = Field('foo') == 1
         c2 = Field('foo', table=self.t).eq(0)