PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: holoviz/holoviews (python)

Issue:
ValueError when updating polyline using PolyEdit tool
https://github.com/holoviz/holoviews/blob/53e904958d5c07b467b4d8ab3683c1c1df30263b/holoviews/plotting/bokeh/callbacks.py#L1410

When updating polyline using PolyEdit tool this line results in the following error: 

`ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()`

The reason for it is in case of EditTool value[2] is a list of numpy arrays, not a str, so quick fix would be to add extra condition to this elif:

`
elif (
    isinstance(values, list)
    and len(values) == 4
    and isinstance(values[2], str )  # Without this line bokeh failes to process updated polylines
    and values[2] in ("big", "little")
    and isinstance(values[3], list)
):
`


Pull request:
fix: PolyEdit stream not synchronizes with CDS
Fixes #6532

In case of using PolyEdit tool value[2] is a list of lists or numpy arrays, not a str.

Patch:
diff --git a/holoviews/plotting/bokeh/callbacks.py b/holoviews/plotting/bokeh/callbacks.py
index c3d596d26..3f438b017 100644
--- a/holoviews/plotting/bokeh/callbacks.py
+++ b/holoviews/plotting/bokeh/callbacks.py
@@ -1407,6 +1407,7 @@ class CDSCallback(Callback):
             elif (
                 isinstance(values, list)
                 and len(values) == 4
+                and isinstance(values[2], str)
                 and values[2] in ("big", "little")
                 and isinstance(values[3], list)
             ):


Test patch:
diff --git a/holoviews/tests/plotting/bokeh/test_callbacks.py b/holoviews/tests/plotting/bokeh/test_callbacks.py
index 592e19b48..d24551b60 100644
--- a/holoviews/tests/plotting/bokeh/test_callbacks.py
+++ b/holoviews/tests/plotting/bokeh/test_callbacks.py
@@ -468,6 +468,31 @@ def test_msg_with_base64_array():
     assert np.equal(data_expected, data_after).all()
 
 
+def test_msg_with_polyedit_polyline():
+    # Account for issue seen in https://github.com/holoviz/holoviews/issues/6532
+    data_before = {
+        "xs": [
+            [10.0, 20.0, 30.0, 40.0],
+            np.array([10.0, 20.0, 30.0, 40.0]),
+            np.array([10.0, 20.0, 30.0, 40.0]),
+            np.array([10.0, 20.0, 30.0, 40.0])
+        ],
+        "ys": [
+            [10.0, 20.0, 30.0, 40.0],
+            np.array([10.0, 20.0, 30.0, 40.0]),
+            np.array([10.0, 20.0, 30.0, 40.0]),
+            np.array([10.0, 20.0, 30.0, 40.0])
+        ],
+        "color": ["#FF0000", "#FF0000", "#FF0000", "#FF0000"],
+        "line_color": ["#FF0000", "#FF0000", "#FF0000", "#FF0000"],
+        "line_width": np.array([2, 2, 2, 2]),
+    }
+    msg_before = {"data": data_before}
+    msg_after = CDSCallback(None, None, None)._process_msg(msg_before)
+    data_after = msg_after["data"]
+    assert np.equal(data_before, data_after).all()
+
+
 @pytest.mark.usefixtures('bokeh_backend')
 def test_rangexy_multi_yaxes():
     c1 = Curve(np.arange(100).cumsum(), vdims='y')
Repository: intel/rohd (dart)

Issue:
Add `Else.s` simple constructor that accepts only 1 `Conditional`
### Motivation

https://github.com/intel/rohd/pull/210 implements `If.s`, `Iff.s`, and `ElseIf.s`, but not `Else.s`.

### Desired solution

It would be nice to also add `Else.s` for completeness.

### Alternatives considered

_No response_

### Additional details

_No response_

Pull request:
<!-- Please make sure you check out the contribution guidelines before submitting a pull request! -->

## Description & Motivation

https://github.com/intel/rohd/pull/210 implements If.s, Iff.s, and ElseIf.s, but not Else.s.

## Related Issue(s)

Fix #225 

## Testing

Add new unit test for single conditionals else then.

## Backwards-compatibility

> Is this a breaking change that will not be backwards-compatible?  If yes, how so?

No.

## Documentation

> Does the change require any updates to documentation?  If so, where?  Are they included?

No.

Patch:
diff --git a/lib/src/modules/conditional.dart b/lib/src/modules/conditional.dart
index ee05d721f..95c932a43 100644
--- a/lib/src/modules/conditional.dart
+++ b/lib/src/modules/conditional.dart
@@ -831,6 +831,12 @@ class Else extends Iff {
   /// If none of the proceding [Iff] or [ElseIf] are executed, then
   /// [then] will be executed.
   Else(List<Conditional> then) : super(Const(1), then);
+
+  /// If none of the proceding [Iff] or [ElseIf] are executed, then
+  /// [then] will be executed.
+  ///
+  /// Use this constructor when you only have a single [then] condition.
+  Else.s(Conditional then) : this([then]);
 }
 
 /// Represents a chain of blocks of code to be conditionally executed, like


Test patch:
diff --git a/test/conditionals_test.dart b/test/conditionals_test.dart
index 468946514..278aff296 100644
--- a/test/conditionals_test.dart
+++ b/test/conditionals_test.dart
@@ -219,6 +219,23 @@ class SingleIfOrElseModule extends Module {
   }
 }
 
+class SingleElseModule extends Module {
+  SingleElseModule(Logic a, Logic b) : super(name: 'combmodule') {
+    a = addInput('a', a);
+    b = addInput('b', b);
+
+    final q = addOutput('q');
+    final x = addOutput('x');
+
+    Combinational([
+      IfBlock([
+        Iff.s(a, q < 1),
+        Else.s(x < 1),
+      ])
+    ]);
+  }
+}
+
 class SignalRedrivenSequentialModule extends Module {
   SignalRedrivenSequentialModule(Logic a, Logic b, Logic d)
       : super(name: 'ffmodule') {
@@ -405,6 +422,21 @@ void main() {
     expect(simResult, equals(true));
   });
 
+  test(
+      'should return true on simcompare when '
+      'execute Else.s() for single else conditional', () async {
+    final mod = SingleElseModule(Logic(), Logic());
+    await mod.build();
+    final vectors = [
+      Vector({'a': 1}, {'q': 1}),
+      Vector({'a': 0}, {'x': 1}),
+    ];
+    await SimCompare.checkFunctionalVector(mod, vectors);
+    final simResult = SimCompare.iverilogVector(
+        mod.generateSynth(), mod.runtimeType.toString(), vectors);
+    expect(simResult, equals(true));
+  });
+
   test(
       'should return SignalRedrivenException when there are multiple drivers '
       'for a flop.', () async {