Northy1717/SWE-bench-Live huggingface dataset:
Repository: qtile/qtile

Issue:
WindowCount widget does not update on togroup() without switch_group
### Issue description

I use keybindings for calling `lazy.window.togroup(name)` (without `switch_group=True`) and I noticed that the WindowCount widget does not update until I change group or spawn/close a window in the current group.

A fix is to subscribe to the `group_window_add` hook in the WindowCount widget. I will prepare a PR.



### Version

0.26.1.dev0+ge4b4bb8b.d20240523

### Backend

X11 (default)

### Config

_No response_

### Logs

_No response_

### Required

- [X] I have searched past issues to see if this bug has already been reported, and it hasn't been.
- [X] I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.


Discussion:

Patch:
diff --git a/libqtile/widget/window_count.py b/libqtile/widget/window_count.py
index 5db97e4a3d..134720f914 100644
--- a/libqtile/widget/window_count.py
+++ b/libqtile/widget/window_count.py
@@ -57,6 +57,7 @@ def _setup_hooks(self):
         hook.subscribe.client_killed(self._win_killed)
         hook.subscribe.client_managed(self._wincount)
         hook.subscribe.current_screen_change(self._wincount)
+        hook.subscribe.group_window_add(self._wincount)
         hook.subscribe.setgroup(self._wincount)
 
     def _wincount(self, *args):


Test patch:
diff --git a/test/widgets/test_window_count.py b/test/widgets/test_window_count.py
index 86cb9edc07..698787c771 100644
--- a/test/widgets/test_window_count.py
+++ b/test/widgets/test_window_count.py
@@ -86,6 +86,10 @@ def test_window_count(manager_nospawn, minimal_conf_noscreen):
     manager_nospawn.c.group["a"].toscreen()
     assert int(manager_nospawn.c.widget["windowcount"].get()) == 2
 
+    # Move a window and check text
+    manager_nospawn.c.window.togroup("b")
+    assert int(manager_nospawn.c.widget["windowcount"].get()) == 1
+
     # Close all windows and check count is 0 and widget not displayed
     manager_nospawn.kill_window(one)
     manager_nospawn.kill_window(two)
Repository: geopandas/geopandas

Issue:
BUG: Creating geoseries from series fails if CRS is passed in
```python
import pandas as pd
import geopandas as gpd

ser = gpd.GeoSeries.from_xy([0,1], [1,2], crs="EPSG:4326")
ser2 = pd.Series(ser)
assert ser2.array.crs == "EPSG:4326"
gpd.GeoSeries(ser2, crs="EPSG:4326")
Traceback (most recent call last):
  File "C:\Users\matt.richards\AppData\Roaming\JetBrains\PyCharmCE2024.1\scratches\scratch_48.py", line 8, in <module>
    gpd.GeoSeries(ser2, crs="EPSG:4326")
  File "C:\Users\matt.richards\.conda\envs\gtfs-to-zenith\lib\site-packages\geopandas\geoseries.py", line 167, in __init__
    if not data.crs == crs:
  File "C:\Users\matt.richards\.conda\envs\gtfs-to-zenith\lib\site-packages\pandas\core\generic.py", line 6299, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'crs'
```

This is a regression in 1.0 from #2858, else clause should use `data_crs` as well. This seems like it might be worthwhile fixing in a bugfix release



Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5121798025..2a74723016 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@
 Bug fixes:
 
 - Properly support named aggregations over a geometry column in `GroupBy.agg` (#3368).
+- Fix regression where constructing a GeoSeries from a pd.Series with GeometryDtype values 
+  failed when `crs` was provided(#3383).
 
 ## Version 1.0.1 (July 2, 2024)
 
diff --git a/geopandas/geoseries.py b/geopandas/geoseries.py
index ea30f61db2..659f55bcfb 100644
--- a/geopandas/geoseries.py
+++ b/geopandas/geoseries.py
@@ -164,7 +164,7 @@ def __init__(self, data=None, index=None, crs: Optional[Any] = None, **kwargs):
                 # make a copy to avoid setting CRS to passed GeometryArray
                 data = data.copy()
             else:
-                if not data.crs == crs:
+                if not data_crs == crs:
                     raise ValueError(
                         "CRS mismatch between CRS of the passed geometries "
                         "and 'crs'. Use 'GeoSeries.set_crs(crs, "


Test patch:
diff --git a/geopandas/tests/test_geoseries.py b/geopandas/tests/test_geoseries.py
index 39590176e6..4d2e2b544f 100644
--- a/geopandas/tests/test_geoseries.py
+++ b/geopandas/tests/test_geoseries.py
@@ -673,6 +673,16 @@ def test_from_series_no_set_crs_on_construction(self):
         assert gs.crs is None
         assert result.crs == "EPSG:4326"
 
+        # https://github.com/geopandas/geopandas/issues/3382
+        s2 = pd.Series(gs.set_crs("EPSG:4326"))
+        result = GeoSeries(s2, crs=4326)
+        assert result.crs == "EPSG:4326"
+        with pytest.raises(
+            ValueError,
+            match="CRS mismatch between CRS of the passed geometries and 'crs'",
+        ):
+            GeoSeries(s2, crs=4283)
+
     def test_copy(self):
         # default is to copy with CoW / pandas 3+
         arr = np.array([Point(x, x) for x in range(3)], dtype=object)
Repository: aws-cloudformation/cfn-lint

Issue:
E1019 triggered for `Fn::Sub` intrinsic function passed non-string (int, float, etc) values
### CloudFormation Lint Version

cfn-lint 1.7.0

### What operating system are you using?

Mac

### Describe the bug

When trying to validate use of a `Fn::Sub` intrinsic function where a variable value is not a string (e.g. an integer or float), `cfn-lint` now raises an E1019 error:

```
E1019 Exception 'expected str instance, int found' raised while validating 'fn_sub'
template.yaml:5:7
```

The example below is contrived; in reality the value comes from a YAML alias on a different resource to keep templates DRY. Changing the value to a string in the document fixes the linting problem but isn't a possible solution as that other resource requires an integer - as far as I understand, there isn't a data type conversion function available in this context.

Use of `Fn::Sub` in this way still deploys fine to CloudFormation and this wasn't previously error in in earlier versions (e.g. < 1.0.0). 

Similarly, the documentation at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html#w43aac23c28c69b7 doesn't require the value being only a string.

(Similar to https://github.com/aws-cloudformation/cfn-lint/issues/1669) 



### Expected behavior

The rule should pass as this works with CloudFormation.

### Reproduction template

```
Resources:
  Parameter:
    Type: AWS::SSM::Parameter
    Properties:
      Name: !Sub
        - example/${Key}
        - Key: 1
      Type: String
      Value: foobar
```


Discussion:

Patch:
diff --git a/src/cfnlint/jsonschema/_resolvers_cfn.py b/src/cfnlint/jsonschema/_resolvers_cfn.py
index 5c84aa3539..9f890b5a20 100644
--- a/src/cfnlint/jsonschema/_resolvers_cfn.py
+++ b/src/cfnlint/jsonschema/_resolvers_cfn.py
@@ -246,7 +246,7 @@ def _replace(matchobj):
                     ref_values=c.ref_values,
                 )
             )
-            return value
+            return str(value)
         raise ValueError(f"No matches for {matchobj.group(2)!r}")
 
     try:


Test patch:
diff --git a/test/unit/rules/functions/test_sub.py b/test/unit/rules/functions/test_sub.py
index ff67ed210f..8162c4f184 100644
--- a/test/unit/rules/functions/test_sub.py
+++ b/test/unit/rules/functions/test_sub.py
@@ -156,6 +156,12 @@ def context(cfn):
             {"type": "string"},
             [],
         ),
+        (
+            "Valid Fn::Sub with an integer parameter",
+            {"Fn::Sub": ["${Foo}", {"Foo": 1}]},
+            {"type": "string"},
+            [],
+        ),
         (
             "Invalid Fn::Sub with a too to many elements",
             {"Fn::Sub": ["${foo}", {"foo": "bar"}, {}]},
Repository: python-control/python-control

Issue:
`control.combine_time_responses` fails to combine time responses
Using `control.combine_time_responses` results in the following error:

```python
AttributeError: 'TimeResponseData' object has no attribute 'types'
```
This is because the code that adds new trace labels to the combined data has a bug where is trying to access a `types` attribute from the `TimeResponseData` objects instead of `trace_types`.


Discussion:

Patch:
diff --git a/control/timeplot.py b/control/timeplot.py
index 2eb7aec9b..f257d2b3a 100644
--- a/control/timeplot.py
+++ b/control/timeplot.py
@@ -738,7 +738,8 @@ def combine_time_responses(response_list, trace_labels=None, title=None):
             if generate_trace_labels:
                 trace_labels.append(response.title)
             trace_types.append(
-                None if response.trace_types is None else response.types[0])
+                None if response.trace_types is None
+                else response.trace_types[0])
 
         else:
             # Save the data


Test patch:
diff --git a/control/tests/timeplot_test.py b/control/tests/timeplot_test.py
index 0fcc159be..58ef062a5 100644
--- a/control/tests/timeplot_test.py
+++ b/control/tests/timeplot_test.py
@@ -258,7 +258,7 @@ def test_combine_time_responses():
     sys_mimo = ct.rss(4, 2, 2)
     timepts = np.linspace(0, 10, 100)
 
-    # Combine two response with ntrace = 0
+    # Combine two responses with ntrace = 0
     U = np.vstack([np.sin(timepts), np.cos(2*timepts)])
     resp1 = ct.input_output_response(sys_mimo, timepts, U)
 
@@ -293,6 +293,7 @@ def test_combine_time_responses():
     combresp4 = ct.combine_time_responses(
         [resp1, resp2, resp3], trace_labels=labels)
     assert combresp4.trace_labels == labels
+    assert combresp4.trace_types == [None, None, 'step', 'step']
 
     # Automatically generated trace label names and types
     resp5 = ct.step_response(sys_mimo, timepts)
@@ -302,7 +303,13 @@ def test_combine_time_responses():
     combresp5 = ct.combine_time_responses([resp1, resp5])
     assert combresp5.trace_labels == [resp1.title] + \
         ["test, trace 0", "test, trace 1"]
-    assert combresp4.trace_types == [None, None, 'step', 'step']
+    assert combresp5.trace_types == [None, None, None]
+
+    # ntraces = 0 with trace_types != None
+    # https://github.com/python-control/python-control/issues/1025
+    resp6 = ct.forced_response(sys_mimo, timepts, U)
+    combresp6 = ct.combine_time_responses([resp1, resp6])
+    assert combresp6.trace_types == [None, 'forced']
 
     with pytest.raises(ValueError, match="must have the same number"):
         resp = ct.step_response(ct.rss(4, 2, 3), timepts)