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

Issue:
E2015 fails on invalid default value
### CloudFormation Lint Version

1.22.7

### What operating system are you using?

Ubuntu

### Describe the bug

This template causes E2015 to crash:

```
E0002 Unknown exception while processing rule E2015: "'bool' object has no attribute 'split'"
```

### Expected behavior

Anything but an unknown exception

### Reproduction template

```yaml
---
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  ParamName:
    Type: List<String>
    Description: Gobledygook
    Default: False
```


Discussion:

Patch:
diff --git a/src/cfnlint/rules/parameters/Default.py b/src/cfnlint/rules/parameters/Default.py
index 240cea7cae..98e9526768 100644
--- a/src/cfnlint/rules/parameters/Default.py
+++ b/src/cfnlint/rules/parameters/Default.py
@@ -140,7 +140,7 @@ def match(self, cfn: Template) -> RuleMatches:
             default_value = paramvalue.get("Default")
             if default_value is not None and self.is_list(paramvalue):
                 comma_delimited_default_values = [
-                    x.strip() for x in default_value.split(",")
+                    x.strip() for x in str(default_value).split(",")
                 ]
                 for value in comma_delimited_default_values:
                     param_cdl_matches.extend(


Test patch:
diff --git a/test/fixtures/templates/good/parameters/default.yaml b/test/fixtures/templates/good/parameters/default.yaml
index 6c3c17b929..a9c042ab3d 100644
--- a/test/fixtures/templates/good/parameters/default.yaml
+++ b/test/fixtures/templates/good/parameters/default.yaml
@@ -75,5 +75,7 @@ Parameters:
       - three,four
   CDLWithoutDefault:
     Type: CommaDelimitedList
-
+  StringList:
+    Type: List<String>
+    Default: False
 Resources: {}
Repository: python-control/python-control

Issue:
ValueError raised for certain systems with nyquist_response
For certain systems, when "indent_direction" is set to 'none', a ValueError is thrown on https://github.com/python-control/python-control/blob/71bd7319fe324f7b7ff14b8210420843bf06d7d2/control/freqplot.py#L1456 when there is an attempt at casting the number of encirclements to an integer, but the number of encirclements is not a valid number (NaN).

Code to reproduce:
```Python
import sympy as smp
from control import tf, nyquist_response
s = tf('s')

tf1 = ((1 + 5/s)/(1 + 0.5/s))**2   # Double-Lag-Compensator

nyquist_response(tf1, warn_encirclements=False, indent_direction='none')
```




Discussion:

Patch:
diff --git a/control/freqplot.py b/control/freqplot.py
index 3bc3a0c24..456431f38 100644
--- a/control/freqplot.py
+++ b/control/freqplot.py
@@ -1447,6 +1447,12 @@ def nyquist_response(
         else:
             contour = np.exp(splane_contour * sys.dt)
 
+        # Make sure we don't try to evaluate at a pole
+        if isinstance(sys, (StateSpace, TransferFunction)):
+            if any([pole in contour for pole in sys.poles()]):
+                raise RuntimeError(
+                    "attempt to evaluate at a pole; indent required")
+
         # Compute the primary curve
         resp = sys(contour)
 


Test patch:
diff --git a/control/tests/nyquist_test.py b/control/tests/nyquist_test.py
index 0d6907b64..8d6fd8561 100644
--- a/control/tests/nyquist_test.py
+++ b/control/tests/nyquist_test.py
@@ -517,6 +517,15 @@ def test_nyquist_frd():
     warnings.resetwarnings()
 
 
+def test_no_indent_pole():
+    s = ct.tf('s')
+    sys = ((1 + 5/s)/(1 + 0.5/s))**2   # Double-Lag-Compensator
+
+    with pytest.raises(RuntimeError, match="evaluate at a pole"):
+        resp = ct.nyquist_response(
+            sys, warn_encirclements=False, indent_direction='none')
+
+
 if __name__ == "__main__":
     #
     # Interactive mode: generate plots for manual viewing
Repository: koxudaxi/datamodel-code-generator

Issue:
null bytes (`\u0000`) not correctly escaped in generated code
**Describe the bug**
A schema containing a NUL character `\u0000` becomes a literal (i.e. not escaped) NUL in the generated Python file. This is a SyntaxError.

> SyntaxError: source code cannot contain null bytes

**To Reproduce**

Example schema:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "bug": {
      "type": "string",
      "enum": ["\u0000"]
    }
  },
  "type": "object"
}
```

Used commandline:
```
$ datamodel-codegen --input-file-type jsonschema --input schema.json --output-model-type pydantic_v2.BaseModel --output model.py
$ python -i model.py
```

**Expected behavior**
Bytes invalid in source code should use the appropriate escape sequence.

**Version:**
 - OS: macOS 13.0.1
 - Python version: 3.11
 - datamodel-code-generator version: 0.25.3

**Additional context**
I first encountered it with regex pattern properties, but it appears to be a general issue with just strings.
Notably this applies to all output-model-types with the exception of `typing.TypedDict`, where it's correctly escaped to `'\x00'` in Literal. 


Discussion:

Patch:
diff --git a/datamodel_code_generator/parser/base.py b/datamodel_code_generator/parser/base.py
index c89a25735..874b64c04 100644
--- a/datamodel_code_generator/parser/base.py
+++ b/datamodel_code_generator/parser/base.py
@@ -65,6 +65,7 @@ def get_special_path(keyword: str, path: List[str]) -> List[str]:
 
 escape_characters = str.maketrans(
     {
+        '\u0000': r'\x00',  # Null byte
         '\\': r'\\',
         "'": r'\'',
         '\b': r'\b',


Test patch:
diff --git a/tests/parser/test_base.py b/tests/parser/test_base.py
index 83fdb46ea..a36951f1b 100644
--- a/tests/parser/test_base.py
+++ b/tests/parser/test_base.py
@@ -7,6 +7,7 @@
 from datamodel_code_generator.model.pydantic import BaseModel, DataModelField
 from datamodel_code_generator.parser.base import (
     Parser,
+    escape_characters,
     exact_import,
     relative,
     sort_data_models,
@@ -284,3 +285,34 @@ def test_no_additional_imports():
 def test_postprocess_result_modules(input_data, expected):
     result = Parser._Parser__postprocess_result_modules(input_data)
     assert result == expected
+
+
+@pytest.fixture
+def escape_map() -> Dict[str, str]:
+    return {
+        '\u0000': r'\x00',  # Null byte
+        "'": r'\'',
+        '\b': r'\b',
+        '\f': r'\f',
+        '\n': r'\n',
+        '\r': r'\r',
+        '\t': r'\t',
+        '\\': r'\\',
+    }
+
+
+@pytest.mark.parametrize(
+    'input_str,expected',
+    [
+        ('\u0000', r'\x00'),  # Test null byte
+        ("'", r'\''),  # Test single quote
+        ('\b', r'\b'),  # Test backspace
+        ('\f', r'\f'),  # Test form feed
+        ('\n', r'\n'),  # Test newline
+        ('\r', r'\r'),  # Test carriage return
+        ('\t', r'\t'),  # Test tab
+        ('\\', r'\\'),  # Test backslash
+    ],
+)
+def test_character_escaping(input_str: str, expected: str) -> None:
+    assert input_str.translate(escape_characters) == expected