Northy1717/SWE-bench-Live huggingface dataset:
Repository: aws-cloudformation/cfn-lint

Issue:
Incorrect E3686 'AWS::RDS::DBCluster' ServerlessV2ScalingConfiguration exists if EngineMode is not set
### CloudFormation Lint Version

1.3.7

### What operating system are you using?

docker container based on python:3.12-alpine

### Describe the bug

```console
$ cfn-lint --template ./a.yaml
E3686 Additional properties are not allowed ('ServerlessV2ScalingConfiguration')
a.yaml:7:7
```


### Expected behavior

Do not report that that ServerlessV2ScalingConfiguration is not allowed.

Default EngineMode property value is "provisioned". So, if EngineMode is not set then error fof ScalingConfiguration property exists, but not error for ServerlessV2ScalingConfiguration property exists.

https://github.com/aws-cloudformation/cfn-lint/blob/3b782cbecf3073ae96ea33e202e4e2a4f15e3a4d/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/serverless_exclusive.json#L50

### Reproduction template

```yaml
Resources:
  AuroraClustor:
    Type: AWS::RDS::DBCluster
    Properties:
      Engine: aurora-postgresql
      EngineVersion: 14.6
      ServerlessV2ScalingConfiguration:
        MaxCapacity: 1
        MinCapacity: 1
```


Discussion:
If you have a chance look at the PR and provide your thoughts



Patch:
diff --git a/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/serverless_exclusive.json b/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/serverless_exclusive.json
index 5976fa7642..a669836ebb 100644
--- a/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/serverless_exclusive.json
+++ b/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/serverless_exclusive.json
@@ -46,8 +46,7 @@
    },
    "then": {
     "properties": {
-     "ScalingConfiguration": false,
-     "ServerlessV2ScalingConfiguration": false
+     "ScalingConfiguration": false
     }
    }
   }


Test patch:
diff --git a/test/unit/rules/resources/rds/test_db_cluster_serverless_exclusive.py b/test/unit/rules/resources/rds/test_db_cluster_serverless_exclusive.py
index ca90c590b8..cc82627b36 100644
--- a/test/unit/rules/resources/rds/test_db_cluster_serverless_exclusive.py
+++ b/test/unit/rules/resources/rds/test_db_cluster_serverless_exclusive.py
@@ -76,26 +76,7 @@ def rule():
         ),
         (
             {"ServerlessV2ScalingConfiguration": "foo"},
-            [
-                ValidationError(
-                    (
-                        "Additional properties are not allowed "
-                        "('ServerlessV2ScalingConfiguration')"
-                    ),
-                    rule=DbClusterServerlessExclusive(),
-                    path=deque(["ServerlessV2ScalingConfiguration"]),
-                    validator=None,
-                    schema_path=deque(
-                        [
-                            "allOf",
-                            2,
-                            "then",
-                            "properties",
-                            "ServerlessV2ScalingConfiguration",
-                        ]
-                    ),
-                )
-            ],
+            [],
         ),
         (
             {"ScalingConfiguration": "foo"},
Repository: cyclotruc/gitingest

Issue:
 Git Ingest request fails on web if the input repo url starts with "http://" instead of "https://"
I think it might be related to `_parse_url` in `parse_query.py` explicitly checking for `"https://"`. Was this intended?
![Screenshot 2024-12-31 190644](https://github.com/user-attachments/assets/621649c8-a942-4478-904f-1287305d5a09)



Discussion:
I am looking into this!




Patch:
diff --git a/src/gitingest/parse_query.py b/src/gitingest/parse_query.py
index 18a78e9a..859cafb2 100644
--- a/src/gitingest/parse_query.py
+++ b/src/gitingest/parse_query.py
@@ -100,7 +100,7 @@ def _parse_url(url: str) -> dict[str, Any]:
     url = url.split(" ")[0]
     url = unquote(url)  # Decode URL-encoded characters
 
-    if not url.startswith("https://"):
+    if not url.startswith(("https://", "http://")):
         url = "https://" + url
 
     # Extract domain and path


Test patch:
diff --git a/src/gitingest/tests/test_parse_query.py b/src/gitingest/tests/test_parse_query.py
index 8ce3ff00..b6b20389 100644
--- a/src/gitingest/tests/test_parse_query.py
+++ b/src/gitingest/tests/test_parse_query.py
@@ -4,7 +4,7 @@
 from gitingest.parse_query import _parse_patterns, _parse_url, parse_query
 
 
-def test_parse_url_valid() -> None:
+def test_parse_url_valid_https() -> None:
     test_cases = [
         "https://github.com/user/repo",
         "https://gitlab.com/user/repo",
@@ -17,6 +17,19 @@ def test_parse_url_valid() -> None:
         assert result["url"] == url
 
 
+def test_parse_url_valid_http() -> None:
+    test_cases = [
+        "http://github.com/user/repo",
+        "http://gitlab.com/user/repo",
+        "http://bitbucket.org/user/repo",
+    ]
+    for url in test_cases:
+        result = _parse_url(url)
+        assert result["user_name"] == "user"
+        assert result["repo_name"] == "repo"
+        assert result["slug"] == "user-repo"
+
+
 def test_parse_url_invalid() -> None:
     url = "https://only-domain.com"
     with pytest.raises(ValueError, match="Invalid repository URL"):
Repository: ipython/ipython

Issue:
autocall full behavior change in 8.27 (not present in 8.26.)
In 8.26 autocall of full checked for `__call__` on the object (I believe). Seems in 8.27 it is much more aggressive and will autocall for **everything**


```
In [17]: foo = dict()

In [18]: foo
-------> foo()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[18], line 1
----> 1 foo()

TypeError: 'dict' object is not callable

In [19]:
```

Not sure if perhaps it is related to this PR #14486 or not


Discussion:
Can maybe this get a bug label just to help folks find that this is a known issue?
@krpatter-intc thanks for the report. I confirm the bug isn't there in 8.26 and appeared in 8.27. Minimal reproducible example requires setting autocall to full

```
In [1]: %autocall 2
Automatic calling is: Full

In [2]: foo = dict()

In [3]: foo
------> foo()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 foo()

TypeError: 'dict' object is not callable
```

I left a comment on the PR you mentioned pointing out likely what's happening. I think the fix might be to put parentheses around the new conditions added in the pr

```python
and (line_info.raw_the_rest.startswith(" ")
    or not line_info.raw_the_rest.strip()) 
```



Patch:
diff --git a/IPython/core/prefilter.py b/IPython/core/prefilter.py
index a29df0c27ad..fc7b1c34161 100644
--- a/IPython/core/prefilter.py
+++ b/IPython/core/prefilter.py
@@ -512,8 +512,10 @@ def check(self, line_info):
             callable(oinfo.obj)
             and (not self.exclude_regexp.match(line_info.the_rest))
             and self.function_name_regexp.match(line_info.ifun)
-            and line_info.raw_the_rest.startswith(" ")
-            or not line_info.raw_the_rest.strip()
+            and (
+                line_info.raw_the_rest.startswith(" ")
+                or not line_info.raw_the_rest.strip()
+            )
         ):
             return self.prefilter_manager.get_handler_by_name("auto")
         else:


Test patch:
diff --git a/IPython/core/tests/test_prefilter.py b/IPython/core/tests/test_prefilter.py
index 999cd43e6e8..379a530e8e5 100644
--- a/IPython/core/tests/test_prefilter.py
+++ b/IPython/core/tests/test_prefilter.py
@@ -137,3 +137,13 @@ def test_autocall_should_support_unicode():
     finally:
         ip.run_line_magic("autocall", "0")
         del ip.user_ns["π"]
+
+
+def test_autocall_regression_gh_14513():
+    ip.run_line_magic("autocall", "2")
+    ip.user_ns["foo"] = dict()
+    try:
+        assert ip.prefilter("foo") == "foo"
+    finally:
+        ip.run_line_magic("autocall", "0")
+        del ip.user_ns["foo"]
Repository: instructlab/instructlab

Issue:
evaluate: users should be warned if they are not setting GPU value
**Is your feature request related to a problem? Please describe.**
Currently, if a user has a GPU-enabled system, we require that they use either the config or GPU flag to ensure that hardware is being utilized. However, we have no indicator to users if they do **not** use this flag that their GPUs are not being utilized in the evaluation. Even in a CPU-only scenario, technically users should be setting `--gpus` to `0` but that is neither documented nor intuitive.

**Describe the solution you'd like**
If  `ilab model evaluate` is run with no GPUs specified for usage, users should receive a warning that no GPUs are being used in their evaluation run. This will indicate to GPU-enabled users that they need to edit their config/flags, and CPU users will be unaffected.

**Additional context**
N/A



Discussion:

Patch:
diff --git a/src/instructlab/model/evaluate.py b/src/instructlab/model/evaluate.py
index f16bd9706b..edff2bf3af 100644
--- a/src/instructlab/model/evaluate.py
+++ b/src/instructlab/model/evaluate.py
@@ -334,6 +334,11 @@ def launch_server(
                     fg="yellow",
                 )
             eval_serve.vllm.vllm_args.extend([tps_prefix, str(gpus)])
+        elif effective_gpus < 1:
+            click.secho(
+                "Evaluate is currently not configured to use GPUs. If you are on a GPU-enabled system edit your config or pass the number of GPUs you would like to use with '--gpus'",
+                fg="yellow",
+            )
 
         if max_workers is not None and isinstance(max_workers, int):
             # Recommend max-workers based on hardware configuration: min(#GPUs being used * 10, #CPU cores) +- 50%


Test patch:
diff --git a/tests/test_lab_evaluate.py b/tests/test_lab_evaluate.py
index c0ab028f90..24aee9440f 100644
--- a/tests/test_lab_evaluate.py
+++ b/tests/test_lab_evaluate.py
@@ -661,3 +661,26 @@ def test_vllm_args_null(_, cli_runner: CliRunner):
         ],
     )
     common.assert_tps(args, "4")
+
+
+@patch("instructlab.model.evaluate.validate_model")
+def test_no_gpu_warning(validate_model_mock, cli_runner: CliRunner):
+    result = cli_runner.invoke(
+        lab.ilab,
+        [
+            "--config=DEFAULT",
+            "model",
+            "evaluate",
+            "--benchmark",
+            "mmlu",
+            "--model",
+            "instructlab/granite-7b-lab",
+            "--backend",
+            "vllm",
+        ],
+    )
+    validate_model_mock.assert_called_once()
+    assert (
+        "Evaluate is currently not configured to use GPUs. If you are on a GPU-enabled system edit your config or pass the number of GPUs you would like to use with '--gpus'"
+        in result.output
+    )
Repository: aws-cloudformation/cfn-lint

Issue:
E3002, E3031 & E3512 for AWS::S3::BucketPolicy with OAI
### CloudFormation Lint Version

1.3.0+ (git a7906eaaa)

### What operating system are you using?

Mac

### Describe the bug

CFN template with an S3 BucketPolicy referencing a CloudFront Origin Access Identity raises 3 errors in cfn-lint v1

```
E3002 '*' was expected
oai.yaml:11:13

E3512 {'AWS': ['arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1234ABCDE12AB']} is not valid under any of the given schemas
oai.yaml:11:13

E3031 'arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1234ABCDE12AB' does not match '^((arn:(aws|aws-cn|aws-us-gov):iam::\\d{12}:(?:root|user|group|role)|\\*)|\\d{12})'
oai.yaml:13:17
```


### Expected behavior

No errors

### Reproduction template

```
AWSTemplateFormatVersion: "2010-09-09"
Resources:
  DestinationS3BucketPolicy:
    Type: 'AWS::S3::BucketPolicy'
    Properties:
      Bucket: 'bucket'
      PolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Sid: 'cfn-lint-v1'
            Principal:
              AWS:
              - 'arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1234ABCDE12AB'
            Action: 's3:ListBucket'
            Effect: Allow
            Resource:
              - 'arn:aws:s3:::bucket'
```


Discussion:

Patch:
diff --git a/src/cfnlint/data/schemas/other/iam/policy.json b/src/cfnlint/data/schemas/other/iam/policy.json
index b6bac4ecc2..ad27109d75 100644
--- a/src/cfnlint/data/schemas/other/iam/policy.json
+++ b/src/cfnlint/data/schemas/other/iam/policy.json
@@ -20,7 +20,14 @@
    "type": "string"
   },
   "AwsPrincipalArn": {
-   "pattern": "^((arn:(aws|aws-cn|aws-us-gov):iam::\\d{12}:(?:root|user|group|role)|\\*)|\\d{12})",
+   "anyOf": [
+    {
+     "pattern": "^((arn:(aws|aws-cn|aws-us-gov):iam::\\d{12}:(?:root|user|group|role)|\\*)|\\d{12})"
+    },
+    {
+     "pattern": "^arn:(aws|aws-cn|aws-us-gov):iam::cloudfront:user/.+$"
+    }
+   ],
    "type": "string"
   },
   "Condition": {


Test patch:
diff --git a/test/unit/rules/resources/iam/test_resource_policy.py b/test/unit/rules/resources/iam/test_resource_policy.py
index 6ca3d61ae6..b88accf9b7 100644
--- a/test/unit/rules/resources/iam/test_resource_policy.py
+++ b/test/unit/rules/resources/iam/test_resource_policy.py
@@ -54,6 +54,7 @@ def test_object_multiple_effect(self):
                         "AWS": [
                             "arn:aws:iam::123456789012:root",
                             "999999999999",
+                            "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1234ABCDE12AB",
                         ],
                         "CanonicalUser": "79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be",
                     },
Repository: pylint-dev/pylint

Issue:
conditional import X.Y causes false positive possibly-used-before-assignment
### Bug description

```python
if input():
    import os.path
else:
    os = None
if os:
    pass
```

### Command used

```console
$ pylint -E condimport.py 
```

### Pylint output

```
condimport.py:5:3: E0606: Possibly using variable 'os' before assignment (possibly-used-before-assignment)
```

### Expected behavior

The `os` variable is set in both branches, so no error should be reported.

### Pylint version

```
pylint 3.3.1
astroid 3.3.5
Python 3.13.0 (main, Oct  8 2024, 08:51:27) [GCC 9.4.0]
```


Discussion:

Patch:
diff --git a/doc/whatsnew/fragments/10081.bugfix b/doc/whatsnew/fragments/10081.bugfix
new file mode 100644
index 0000000000..69828be5af
--- /dev/null
+++ b/doc/whatsnew/fragments/10081.bugfix
@@ -0,0 +1,3 @@
+Fixed conditional import x.y causing false positive possibly-used-before-assignment.
+
+Closes #10081
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index da357a66d1..20189ebdec 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -931,7 +931,9 @@ def _defines_name_raises_or_returns(name: str, node: nodes.NodeNG) -> bool:
             ):
                 return True
         if isinstance(node, (nodes.Import, nodes.ImportFrom)) and any(
-            (node_name[1] and node_name[1] == name) or (node_name[0] == name)
+            (node_name[1] and node_name[1] == name)
+            or (node_name[0] == name)
+            or (node_name[0].startswith(name + "."))
             for node_name in node.names
         ):
             return True


Test patch:
diff --git a/tests/functional/u/used/used_before_assignment.py b/tests/functional/u/used/used_before_assignment.py
index 360be6a4f3..a9f441a3df 100644
--- a/tests/functional/u/used/used_before_assignment.py
+++ b/tests/functional/u/used/used_before_assignment.py
@@ -289,3 +289,11 @@ def inner_for():
     inner_try()
     inner_while()
     inner_for()
+
+def conditional_import():
+    if input():
+        import os.path
+    else:
+        os = None
+    if os:
+        pass