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

Issue:
OUI hashability
# Summary
`OUI` does not have a `__hash__` function.  This prevents the use of `OUI` for keys.
- Python Hash documentation [link](https://docs.python.org/3/reference/datamodel.html#object.__hash__)

# Example - Break
```
from netaddr import OUI

a = OUI("002272")

try:
    set(a)
except TypeError:
    print("Hash failed")
```

# Example - Fix
```
from netaddr import OUI

a = OUI("002272")
set(a)
```

Comments:

Patch:
diff --git a/netaddr/eui/__init__.py b/netaddr/eui/__init__.py
index 5639676..07bbdc3 100644
--- a/netaddr/eui/__init__.py
+++ b/netaddr/eui/__init__.py
@@ -100,6 +100,9 @@ class OUI(BaseIdentifier):
         else:
             raise NotRegisteredError('OUI %r not registered!' % (oui,))
 
+    def __hash__(self):
+        return hash(self._value)
+
     def __eq__(self, other):
         if not isinstance(other, OUI):
             try:


Test patch:
diff --git a/netaddr/tests/eui/test_eui.py b/netaddr/tests/eui/test_eui.py
index 645a518..c17d0ce 100644
--- a/netaddr/tests/eui/test_eui.py
+++ b/netaddr/tests/eui/test_eui.py
@@ -186,6 +186,14 @@ def test_oui_constructor():
     assert oui.reg_count == 3
 
 
+def test_oui_hash():
+    oui0 = OUI(0)
+    oui1 = OUI(1)
+    oui_dict = {oui0: None, oui1: None}
+
+    assert list(oui_dict.keys()) == [OUI(0), OUI(1)]
+
+
 def test_eui_iab():
     mac = EUI('00-50-C2-00-0F-01')
     assert mac.is_iab()