nebius/SWE-bench-extra huggingface dataset:
Repository: Viatorus/quom

Issue:
option to skip already included files
Hello and thanks for creating such awesome utility! I'm using it in my [CTRE](https://github.com/hanickadot/compile-time-regular-expressions) project. I noticed sometimes quom include same file multiple times. 

Would be possible to add an option to ignore already included files? Based on normalised URL preferably. 

Thanks! ❤️

Comments:

Patch:
diff --git a/src/quom/quom.py b/src/quom/quom.py
index 5dbaad9..5f7d51c 100644
--- a/src/quom/quom.py
+++ b/src/quom/quom.py
@@ -80,6 +80,7 @@ class Quom:
                 raise QuomError('Include not found: "{}"'.format(include_path))
 
         # Skip already processed files.
+        file_path = file_path.resolve()
         if file_path in self.__processed_files:
             return
         self.__processed_files.add(file_path)


Test patch:
diff --git a/tests/test_quom/same_file_different_include.py b/tests/test_quom/same_file_different_include.py
new file mode 100644
index 0000000..8ef3b9d
--- /dev/null
+++ b/tests/test_quom/same_file_different_include.py
@@ -0,0 +1,41 @@
+import os
+from io import StringIO
+
+from quom import Quom
+
+FILE_FOO_HPP = """
+#include "../b/bar.hpp"
+"""
+
+FILE_BAR_HPP = """
+int foo();
+"""
+
+FILE_MAIN_CPP = """
+#include "a/foo.hpp"
+#include "b/bar.hpp"
+"""
+
+RESULT = """
+
+int foo();
+"""
+
+
+def test_same_file_different_include(fs):
+    os.makedirs('a')
+    os.makedirs('b')
+
+    with open('main.cpp', 'w+') as file:
+        file.write(FILE_MAIN_CPP)
+
+    with open('a/foo.hpp', 'w+') as file:
+        file.write(FILE_FOO_HPP)
+
+    with open('b/bar.hpp', 'w+') as file:
+        file.write(FILE_BAR_HPP)
+
+    dst = StringIO()
+    Quom('main.cpp', dst)
+
+    assert dst.getvalue() == RESULT
Repository: WIPACrepo/iceprod

Issue:
remove getip.php request
This request: http://simprod.icecube.wisc.edu/downloads/getip.php
is on an old SL6 server.  We'd like to decommission that server.  Replace this lookup with something else, or remove entirely.

Comments:

Patch:
diff --git a/iceprod/core/functions.py b/iceprod/core/functions.py
index 964f20b9..619cc991 100644
--- a/iceprod/core/functions.py
+++ b/iceprod/core/functions.py
@@ -270,16 +270,11 @@ def get_local_ip_address():
 def gethostname():
     """Get hostname of this computer."""
     ret = socket.getfqdn()
-    try:
-        resp = requests.get('http://simprod.icecube.wisc.edu/downloads/getip.php', timeout=1)
-        resp.raise_for_status()
-        logging.info('getip: %r', resp.text)
-        ret2 = resp.text.split(' ')[-1]
-        if len(ret2.split('.')) > 1:
-            ret = '.'.join(ret.split('.')[:1]+ret2.split('.')[1:])
-    except Exception:
-        logging.info('error getting global ip', exc_info=True)
-    return ret
+    ret2 = socket.gethostname()
+    if len(ret2) > len(ret):
+        return ret2
+    else:
+        return ret
 
 
 @contextmanager


Test patch:
diff --git a/tests/core/functions_test.py b/tests/core/functions_test.py
index ffe9f4ac..9ece4946 100644
--- a/tests/core/functions_test.py
+++ b/tests/core/functions_test.py
@@ -672,29 +672,25 @@ class functions_test(AsyncTestCase):
             logging.info('%s',e)
 
     @patch('socket.getfqdn')
-    @requests_mock.mock()
+    @patch('socket.gethostname')
     @unittest_reporter
-    def test_301_gethostname(self, fqdn, http_mock):
+    def test_301_gethostname(self, fqdn, hostname):
         fqdn.return_value = 'myhost'
-        http_mock.get('/downloads/getip.php', text='123 myhost')
+        hostname.return_value = 'myhost'
         host = iceprod.core.functions.gethostname()
         self.assertEqual(host, 'myhost')
-        self.assertEqual(http_mock.call_count, 1)
 
-        http_mock.get('/downloads/getip.php', text='123 dyn.test.com')
+        hostname.return_value = 'myhost.test.com'
         host = iceprod.core.functions.gethostname()
         self.assertEqual(host, 'myhost.test.com')
-        self.assertEqual(http_mock.call_count, 2)
 
         fqdn.return_value = 'myhost.foo.bar'
         host = iceprod.core.functions.gethostname()
         self.assertEqual(host, 'myhost.test.com')
-        self.assertEqual(http_mock.call_count, 3)
 
         fqdn.return_value = 'myhost.foo.bar.baz'
         host = iceprod.core.functions.gethostname()
-        self.assertEqual(host, 'myhost.test.com')
-        self.assertEqual(http_mock.call_count, 4)
+        self.assertEqual(host, 'myhost.foo.bar.baz')
 
     @unittest_reporter
     def test_302_isurl(self):