nebius/SWE-bench-extra huggingface dataset:
Repository: bids-standard/pybids

Issue:
Bug/Ambiguous parsing when extension but no suffix present
Found a bit of buggy parsing when fuzzing inputs on another project.

For the following dataset:
```
sub-0
	sub-0.ext
```

The sole file gets parsed with the following entities:


```py
{'extension': '.ext', 'subject': '0', 'suffix': '0'}
```

Clearly `0` should not be attached both to `subject` and `suffix`.

My inclination is to add a negative lookbehind to the `suffix` regex preventing alphanums preceded by a `-` from being matched: `(?<!-)[._]*([a-zA-Z0-9]*?)\.[^\/\\]$`. This should generally prevent it from snatching the values from other entities.

However, I'm not sure if bids *requires* files with extensions to also have suffixes? The regexes in the config file seem to suggest this is so (the `suffix` and `extension` regexes are identical, with only the capture group location moved).

But even if so, pybids needs to do *something* with the above file, and ignoring it as invalid seems harsh.

Also not sure how this situation will change if official bids spec files are used.

Comments:

Patch:
diff --git a/.zenodo.json b/.zenodo.json
index 8083d1d5..890e0bcb 100644
--- a/.zenodo.json
+++ b/.zenodo.json
@@ -43,7 +43,9 @@
       "orcid": "0000-0002-1535-9767"
     },
     {
-      "name": "Papadopoulos Orfanos, Dimitri"
+      "affiliation": "CEA",
+      "name": "Papadopoulos Orfanos, Dimitri",
+      "orcid": "0000-0002-1242-8990"
     },
     {
       "affiliation": "University of Texas at Austin",
diff --git a/bids/layout/config/bids.json b/bids/layout/config/bids.json
index dada4b1c..bad844ad 100644
--- a/bids/layout/config/bids.json
+++ b/bids/layout/config/bids.json
@@ -95,7 +95,7 @@
         },
         {
             "name": "suffix",
-            "pattern": "[._]*([a-zA-Z0-9]*?)\\.[^/\\\\]+$"
+            "pattern": "(?:^|[_/\\\\])([a-zA-Z0-9]+)\\.[^/\\\\]+$"
         },
         {
             "name": "scans",
@@ -111,7 +111,7 @@
         },
         {
             "name": "extension",
-            "pattern": "[._]*[a-zA-Z0-9]*?(\\.[^/\\\\]+)$"
+            "pattern": "[^./\\\\](\\.[^/\\\\]+)$"
         }
     ],
     "default_path_patterns": [


Test patch:
diff --git a/bids/layout/tests/test_utils.py b/bids/layout/tests/test_utils.py
index 1023fb76..26f1511b 100644
--- a/bids/layout/tests/test_utils.py
+++ b/bids/layout/tests/test_utils.py
@@ -48,6 +48,19 @@ def test_parse_file_entities(mock_config):
     assert target == parse_file_entities(filename, entities=entities)
 
 
+@pytest.mark.parametrize(
+    "filename, target",
+    [
+        ('/path/to/sub-01.ext', {'subject': '01', 'extension': '.ext'}),
+        ('/path/to/stub.ext', {'suffix': 'stub', 'extension': '.ext'}),
+        ('/path/to/.dotfile', {}),
+        ('/path/to/stub', {}),
+    ]
+)
+def test_parse_degenerate_files(mock_config, filename, target):
+    assert parse_file_entities(filename, config='bids') == target
+
+
 def test_add_config_paths():
     bids_dir = os.path.dirname(bids.__file__)
     bids_json = os.path.join(bids_dir, 'layout', 'config', 'bids.json')
Repository: bimpression/sosw

Issue:
Labourer: get_max_labourer_duration
Implement me.
Should receive this information from AWS API probably with DescribeFunction and cache this data in the Ecology Manager

Comments:

Patch:
diff --git a/sosw/managers/ecology.py b/sosw/managers/ecology.py
index dbe0fb5..14ff1e8 100644
--- a/sosw/managers/ecology.py
+++ b/sosw/managers/ecology.py
@@ -31,8 +31,7 @@ ECO_STATUSES = (
 
 
 class EcologyManager(Processor):
-    DEFAULT_CONFIG = {
-    }
+    DEFAULT_CONFIG = {}
 
     running_tasks = defaultdict(int)
     task_client: TaskManager = None  # Will be Circular import! Careful!
@@ -124,11 +123,10 @@ class EcologyManager(Processor):
     def get_max_labourer_duration(self, labourer: Labourer) -> int:
         """
         Maximum duration of `labourer` executions.
-        Should ask this from aws:lambda API, but at the moment use the hardcoded maximum.
-        # TODO implement me.
         """
 
-        return 900
+        resp = self.task_client.lambda_client.get_function_configuration(FunctionName=labourer.arn)
+        return resp['Timeout']
 
 
     # The task_client of EcologyManager is just a pointer. We skip recursive stats to avoid infinite loop.


Test patch:
diff --git a/sosw/managers/test/unit/test_ecology.py b/sosw/managers/test/unit/test_ecology.py
index 7637e2d..90f552f 100644
--- a/sosw/managers/test/unit/test_ecology.py
+++ b/sosw/managers/test/unit/test_ecology.py
@@ -109,3 +109,10 @@ class ecology_manager_UnitTestCase(unittest.TestCase):
         # But the counter of tasks in cache should have.
         self.assertEqual(self.manager.running_tasks[self.LABOURER.id],
                          tm.get_count_of_running_tasks_for_labourer.return_value + 1 + 5)
+
+
+    def test_get_max_labourer_duration(self):
+        self.manager.task_client = MagicMock()
+        self.manager.task_client.lambda_client.get_function_configuration.return_value = {'Timeout': 300}
+
+        self.assertEqual(self.manager.get_max_labourer_duration(self.LABOURER), 300)