PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: CS-SI/eodag (python)

Issue:
guess_product_type doesn't return all the matching products
The method `Searcher.search()` of *whoosh* [accepts a `limit` parameter](https://whoosh.readthedocs.io/en/latest/searching.html#the-searcher-object) that can be set to `None` to get all the results. By default `limit` is set to 10. I think we should set `limit=None` to make sure that `guess_product_type` returns the best matching products. This limiting parameter is provided by *whoosh* for performance reasons, I don't think performance is a problem for us here.

While I'm at it, should `guess_product_type` be actually part of the public API of eodag? We don't use it in any of the notebooks. It's also difficult to use without looking directly at the source code to find which search keys it supports (e.g. `platformSerialIdentifier`).

Pull request:
Whoosh search returns now all the matching products
Fixes #174 

The catalog we use is small so this should have no effect at all in terms of performance. However it should help to make sure that the product type returned by `guess_product_type` is really the best match among all the products that matched each criteria.

Depends on #190

Patch:
diff --git a/eodag/api/core.py b/eodag/api/core.py
index 6b84203c..31a214cd 100644
--- a/eodag/api/core.py
+++ b/eodag/api/core.py
@@ -428,7 +428,7 @@ class EODataAccessGateway(object):
                     kwargs[search_key]
                 )
                 if results is None:
-                    results = searcher.search(query)
+                    results = searcher.search(query, limit=None)
                 else:
                     results.upgrade_and_extend(searcher.search(query))
             guesses = [r["ID"] for r in results or []]


Test patch:
diff --git a/tests/units/test_core.py b/tests/units/test_core.py
index 221f70bc..4bde0171 100644
--- a/tests/units/test_core.py
+++ b/tests/units/test_core.py
@@ -520,6 +520,19 @@ class TestCoreSearch(unittest.TestCase):
         with self.assertRaises(NoMatchingProductType):
             self.dag.guess_product_type()
 
+    def test_guess_product_type_has_no_limit(self):
+        """guess_product_type must run a whoosh search without any limit"""
+        # Filter that should give more than 10 products referenced in the catalog.
+        opt_prods = [
+            p for p in self.dag.list_product_types() if p["sensorType"] == "OPTICAL"
+        ]
+        if len(opt_prods) <= 10:
+            self.skipTest("This test requires that more than 10 products are 'OPTICAL'")
+        guesses = self.dag.guess_product_type(
+            sensorType="OPTICAL",
+        )
+        self.assertGreater(len(guesses), 10)
+
     def test__prepare_search_no_parameters(self):
         """_prepare_search must create some kwargs even when no parameter has been provided"""  # noqa
         prepared_search = self.dag._prepare_search()
Repository: rust-analyzer/rust-analyzer (rust)

Issue:
Autocompletion on Match arms has Inversed
Hello!

I believe autocompletion in Match statements has inverted. I'll explain:

![image](https://user-images.githubusercontent.com/31973761/80988943-18220300-8de9-11ea-88a6-7eeb871a41b9.png)


Here, we have some Match with some Enum being returned on the first Arm. Rustc has therefore decided that each arm is of type `Repo`, and that therefore, my other arms are in a failure state, as they do not have such a return type. If this is true, and with no other code present, then RA should agree with `x` now being of the type `Repo`, but it's still typed as `()`. 

Now, if I do this...
![image](https://user-images.githubusercontent.com/31973761/80989129-5d463500-8de9-11ea-94fd-52e3fac3df37.png)

The RA now says that X is of type `Repo`, when Rustc actually thinks this Match should return a  `()`!

I realize this is only an error case, and filling these arms up with `todo` or `unreachable` essentially makes them be in agreement, but going bottom up is a little counter intuitive. Personally, it interrupts how I program, since I frequently make match arms at the top, fill in one branch, and then live with the errors but with the type checking until I'm ready to go back.

Side note: this has nothing to do with the `_` match. the follow demonstrates that:

![image](https://user-images.githubusercontent.com/31973761/80989400-bd3cdb80-8de9-11ea-8b09-a6e81d7e14a6.png)

I also feel like this wasn't the case before the update this morning? But not positively sure.

Thanks for all the great work all!

Pull request:
Use first match branch in case of type mismatch, not last
The comment says this was intentional, but I do agree with #4304 that it makes
more sense the other way around (for if/else as well).

Fixes #4304.

Patch:
diff --git a/crates/ra_hir_ty/src/infer/coerce.rs b/crates/ra_hir_ty/src/infer/coerce.rs
index 2ee9adb164..32c7c57cd6 100644
--- a/crates/ra_hir_ty/src/infer/coerce.rs
+++ b/crates/ra_hir_ty/src/infer/coerce.rs
@@ -45,9 +45,7 @@ impl<'a> InferenceContext<'a> {
                 self.coerce_merge_branch(&ptr_ty1, &ptr_ty2)
             } else {
                 mark::hit!(coerce_merge_fail_fallback);
-                // For incompatible types, we use the latter one as result
-                // to be better recovery for `if` without `else`.
-                ty2.clone()
+                ty1.clone()
             }
         }
     }


Test patch:
diff --git a/crates/ra_hir_ty/src/tests/simple.rs b/crates/ra_hir_ty/src/tests/simple.rs
index fd2208af28..daa9cc953f 100644
--- a/crates/ra_hir_ty/src/tests/simple.rs
+++ b/crates/ra_hir_ty/src/tests/simple.rs
@@ -937,7 +937,7 @@ fn main(foo: Foo) {
     51..107 'if tru...     }': ()
     54..58 'true': bool
     59..67 '{      }': ()
-    73..107 'if fal...     }': ()
+    73..107 'if fal...     }': i32
     76..81 'false': bool
     82..107 '{     ...     }': i32
     92..95 'foo': Foo
Repository: livebook-dev/kino (elixir)

Issue:
Kino.Input.utc_datetime uses DateTime.compare to compare NaiveDateTime values
_Found while working on #327, thanks to `ElixirLS Dialyzer`._

Turns out that passing any option to `Kino.Input.utc_datetime` will cause a `FunctionClauseError (no function clause matching in DateTime.compare/2)`.

Pull request:
Fix Kino.Input.utc_datetime opts validation
The min, max and default options are all converted to a `NaiveDateTime`, so we cannot compare them using `DateTime`.

Fixes #335.

Patch:
diff --git a/lib/kino/input.ex b/lib/kino/input.ex
index f44789c..556cdd2 100644
--- a/lib/kino/input.ex
+++ b/lib/kino/input.ex
@@ -275,7 +275,7 @@ defmodule Kino.Input do
     max = Keyword.get(opts, :max, nil) |> truncate_datetime()
     default = Keyword.get(opts, :default, nil) |> truncate_datetime()
 
-    if min && max && DateTime.compare(min, max) == :gt do
+    if min && max && NaiveDateTime.compare(min, max) == :gt do
       raise ArgumentError,
             "expected :min to be less than :max, got: #{inspect(min)} and #{inspect(max)}"
     end
@@ -286,11 +286,11 @@ defmodule Kino.Input do
       &(is_struct(&1, NaiveDateTime) or &1 == nil)
     )
 
-    if min && default && DateTime.compare(default, min) == :lt do
+    if min && default && NaiveDateTime.compare(default, min) == :lt do
       raise ArgumentError, "expected :default to be bigger than :min, got: #{inspect(default)} "
     end
 
-    if max && default && DateTime.compare(default, max) == :gt do
+    if max && default && NaiveDateTime.compare(default, max) == :gt do
       raise ArgumentError, "expected :default to be smaller than :max, got: #{inspect(default)}"
     end
 


Test patch:
diff --git a/test/kino/input_test.exs b/test/kino/input_test.exs
index 7f7c28e..abd4f20 100644
--- a/test/kino/input_test.exs
+++ b/test/kino/input_test.exs
@@ -62,6 +62,35 @@ defmodule Kino.InputTest do
     end
   end
 
+  describe "utc_datetime/2" do
+    test "raises when :min is after :max" do
+      assert_raise ArgumentError, fn ->
+        Kino.Input.utc_datetime("Input",
+          min: ~U[2023-02-01 17:32:12Z],
+          max: ~U[2023-01-01 17:32:12Z]
+        )
+      end
+    end
+
+    test "raises when :default is before :min" do
+      assert_raise ArgumentError, fn ->
+        Kino.Input.utc_datetime("Input",
+          default: ~U[2023-01-01 17:32:12Z],
+          min: ~U[2023-02-01 17:32:12Z]
+        )
+      end
+    end
+
+    test "raises when :default is after :max" do
+      assert_raise ArgumentError, fn ->
+        Kino.Input.utc_datetime("Input",
+          default: ~U[2023-02-01 17:32:12Z],
+          max: ~U[2023-01-01 17:32:12Z]
+        )
+      end
+    end
+  end
+
   describe "file/2" do
     test "raises an error when :accept is an empty list" do
       assert_raise ArgumentError, "expected :accept to be a non-empty list, got: []", fn ->