PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: dashbitco/nimble_options (elixir)

Issue:
Timeout type
`non_neg_integer | :infinity`

thoughts?

Pull request:
Add the :timeout type
Closes #16. cc @wojtekmach @josevalim 

Patch:
diff --git a/lib/nimble_options.ex b/lib/nimble_options.ex
index 1fca9bb..a7df6de 100644
--- a/lib/nimble_options.ex
+++ b/lib/nimble_options.ex
@@ -84,6 +84,8 @@ defmodule NimbleOptions do
 
     * `:pos_integer` - A positive integer.
 
+    * `:timeout` - A non-negative integer or the atom `:infinity`.
+
     * `:mfa` - A named function in the format `{module, function, arity}`
 
     * `:mod_arg` - A module along with arguments, e.g. `{MyModule, [arg1, arg2]}`.
@@ -164,7 +166,8 @@ defmodule NimbleOptions do
     :mfa,
     :mod_arg,
     :string,
-    :boolean
+    :boolean,
+    :timeout
   ]
 
   @type schema() :: keyword()
@@ -311,6 +314,12 @@ defmodule NimbleOptions do
     {:error, "expected #{inspect(key)} to be an atom, got: #{inspect(value)}"}
   end
 
+  defp validate_type(:timeout, key, value)
+       when not (value == :infinity or (is_integer(value) and value >= 0)) do
+    {:error,
+     "expected #{inspect(key)} to be non-negative integer or :infinity, got: #{inspect(value)}"}
+  end
+
   defp validate_type(:string, key, value) when not is_binary(value) do
     {:error, "expected #{inspect(key)} to be an string, got: #{inspect(value)}"}
   end


Test patch:
diff --git a/test/nimble_options_test.exs b/test/nimble_options_test.exs
index e81e1f3..41b4785 100644
--- a/test/nimble_options_test.exs
+++ b/test/nimble_options_test.exs
@@ -29,7 +29,7 @@ defmodule NimbleOptionsTest do
       Reason: invalid option type :foo.
 
       Available types: :any, :keyword_list, :non_empty_keyword_list, :atom, \
-      :non_neg_integer, :pos_integer, :mfa, :mod_arg, :string, :boolean, \
+      :non_neg_integer, :pos_integer, :mfa, :mod_arg, :string, :boolean, :timeout, \
       {:fun, arity}, {:custom, mod, fun, args}\
       """
 
@@ -217,6 +217,34 @@ defmodule NimbleOptionsTest do
                {:error, "expected :required to be an boolean, got: :an_atom"}
     end
 
+    test "valid timeout" do
+      schema = [timeout: [type: :timeout]]
+
+      opts = [timeout: 0]
+      assert NimbleOptions.validate(opts, schema) == {:ok, opts}
+
+      opts = [timeout: 1000]
+      assert NimbleOptions.validate(opts, schema) == {:ok, opts}
+
+      opts = [timeout: :infinity]
+      assert NimbleOptions.validate(opts, schema) == {:ok, opts}
+    end
+
+    test "invalid timeout" do
+      schema = [timeout: [type: :timeout]]
+
+      opts = [timeout: -1]
+
+      assert NimbleOptions.validate(opts, schema) ==
+               {:error, "expected :timeout to be non-negative integer or :infinity, got: -1"}
+
+      opts = [timeout: :invalid]
+
+      assert NimbleOptions.validate(opts, schema) ==
+               {:error,
+                "expected :timeout to be non-negative integer or :infinity, got: :invalid"}
+    end
+
     test "valid mfa" do
       schema = [transformer: [type: :mfa]]
Repository: ioos/compliance-checker (python)

Issue:
Climatology cell_methods check bug
**Version of compliance checker running:** latest develop code, commit bfdcf8bbe87cfe22de929b00511d18dac94001ba

**Describe the checker this affects:** CF

**Attach a minimal CDL or NetCDF file which is able to reproduce the issue**
```
netcdf bug {
dimensions:
	time = 1 ;
        nv = 2 ;
variables:
	float time(time) ;
		time:climatology = "climatology_bounds" ;
		time:units = "days since 1900-01-01" ;
                time:long_name = "time" ;
	float climatology_bounds(time, nv) ;
	float v(time) ;
                v:cell_methods = "time: mean within years time: mean over years" ;
                v:long_name = "v" ;

:Conventions = "CF-1.8" ;
:title = "bug" ;
:history = "none" ;

data:

 time = 35795 ;
 climatology_bounds = 35795, 43100 ;
}
```

**To Reproduce:**
`compliance-checker -t cf:1.8 bug.nc`

**Describe the issue below:**
This regexp in your code seems not handle well the CF spec: https://github.com/ioos/compliance-checker/blob/develop/compliance_checker/cf/cf_1_6.py#L3266

Pull request:
Fix two argument form of climatology cell_methods
Fixes #1144 

Patch:
diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py
index 2bdb5f5..2ca9fef 100644
--- a/compliance_checker/cf/cf_1_6.py
+++ b/compliance_checker/cf/cf_1_6.py
@@ -3265,8 +3265,8 @@ class CF1_6Check(CFNCCheck):
         )  # "or" comparison for the methods
         re_string = (
             rf"^time: {meth_regex} within (years|days)"  # regex string to test
-            rf" time: {meth_regex} over \1(?<=days)(?: time: {meth_regex} over years)?"
-            r"(?: \([^)]+\))?$"
+            rf" time: {meth_regex} over \1(:?(?<=days) time: {meth_regex} over years)?"
+            r"(?: \([^)]+\))?$"  # parenthesized comment section
         )
 
         # find any variables with a valid climatological cell_methods


Test patch:
diff --git a/compliance_checker/tests/test_cf.py b/compliance_checker/tests/test_cf.py
index f1a3ddd..187d7a7 100644
--- a/compliance_checker/tests/test_cf.py
+++ b/compliance_checker/tests/test_cf.py
@@ -742,6 +742,11 @@ class TestCF1_6(BaseTestCase):
         results = self.cf.check_climatological_statistics(dataset)
         score, out_of, messages = get_results(results)
         self.assertEqual(score, out_of)
+        # two time expression
+        temp_var.cell_methods = "time: mean within years time: mean over years"
+        results = self.cf.check_climatological_statistics(dataset)
+        score, out_of, messages = get_results(results)
+        self.assertEqual(score, out_of)
 
         # TEST CONFORMANCE 7.4 REQUIRED 5/6
         dataset.variables["climatology_bounds"] = MockVariable(