PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: pinojs/pino (js)
Issue: Options are ignored when logging to a file
Some pino options are ignored when the destination is a file. Also, `useLevelLabels` seems to be able to change after a logger is already created.

Repro code:

```js
const pino = require('pino')

const opts = {
  base: null,
  timestamp: () => ',"time":"none"',
  useLevelLabels: true
}
const logger = pino(opts, './my.log')

logger.info('first')
pino(opts).info('second') // stdout
logger.info('third')
```

Contents of `my.log`:

```json
{"level":30,"time":1535948917084,"msg":"first","pid":34728,"hostname":"ubuntu","v":1}
{"level":"info","time":1535948917085,"msg":"third","pid":34728,"hostname":"ubuntu","v":1}
```

Terminal output:

```json
{"level":"info","time":"none","msg":"second","v":1}
```

Notice how the `base` and `timestamp` options have no effect on the logger that writes to `./my.log`.
Also notice how `useLevelLabels` is ignored at first, but then works after the second logger is created that writes to `stdout`.

Pino: v5.4.0
Node: v10.9.0
OS: Ubuntu 18.04, Windows 10
Pull request description: Do not override opts if the destination is a string
Fixes #512.

Patch:
diff --git a/lib/tools.js b/lib/tools.js
index 439c9f4..4a03e4a 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -242,12 +242,9 @@ function createArgsNormalizer (defaultOptions) {
     if (typeof opts === 'string') {
       stream = new SonicBoom(opts)
       opts = {}
-    }
-    if (typeof stream === 'string') {
+    } else if (typeof stream === 'string') {
       stream = new SonicBoom(stream)
-      opts = {}
-    }
-    if (opts instanceof SonicBoom || opts.writable || opts._writableState) {
+    } else if (opts instanceof SonicBoom || opts.writable || opts._writableState) {
       stream = opts
       opts = null
     }


Test patch:
diff --git a/test/basic.test.js b/test/basic.test.js
index bb1082c..b241140 100644
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -448,7 +448,7 @@ test('auto pino.destination with a string as second argument', async ({ same })
     os.tmpdir(),
     '_' + Math.random().toString(36).substr(2, 9)
   )
-  const instance = pino({}, tmp)
+  const instance = pino(null, tmp)
   instance.info('hello')
   await sleep(250)
   const result = JSON.parse(readFileSync(tmp).toString())
@@ -462,6 +462,27 @@ test('auto pino.destination with a string as second argument', async ({ same })
   })
 })
 
+test('does not override opts with a string as second argument', async ({ same }) => {
+  const tmp = join(
+    os.tmpdir(),
+    '_' + Math.random().toString(36).substr(2, 9)
+  )
+  const instance = pino({
+    timestamp: () => ',"time":"none"'
+  }, tmp)
+  instance.info('hello')
+  await sleep(250)
+  const result = JSON.parse(readFileSync(tmp).toString())
+  same(result, {
+    pid: pid,
+    hostname: hostname,
+    level: 30,
+    time: 'none',
+    msg: 'hello',
+    v: 1
+  })
+})
+
 // https://github.com/pinojs/pino/issues/222
 test('children with same names render in correct order', async ({ is }) => {
   const stream = sink()
Repository: jira-node/node-jira-client (js)
Issue: Can't set strictSSL to false
Looking at line 22: `this.strictSSL = options.strictSSL || true;`, strictSSL will always be true:

```
$ node
> const obj = { strictSSL: false };
undefined
> obj.strictSSL || true;
true
```
Pull request description: Bugfix strict ssl
Fixes #54 by allowing strictSSL to be false.

Patch:
diff --git a/src/jira.js b/src/jira.js
index c071698..645a05f 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -19,7 +19,7 @@ export default class JiraApi {
     this.port = options.port || null;
     this.apiVersion = options.apiVersion || '2';
     this.base = options.base || '';
-    this.strictSSL = options.strictSSL || true;
+    this.strictSSL = options.hasOwnProperty('strictSSL') ? options.strictSSL : true;
       // This is so we can fake during unit tests
     this.request = options.request || request;
     this.webhookVersion = options.webHookVersion || '1.0';


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 41cddc1..ebf98a0 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -10,7 +10,7 @@ function getOptions(options) {
     password: actualOptions.password || 'somepassword',
     apiVersion: actualOptions.apiVersion || '2.0',
     base: actualOptions.base || '',
-    strictSSL: actualOptions.strictSSL || true,
+    strictSSL: actualOptions.hasOwnProperty('strictSSL') ? actualOptions.strictSSL : true,
     request: actualOptions.request,
     oauth: actualOptions.oauth || null,
   };
@@ -69,6 +69,16 @@ describe('Jira API Tests', () => {
 
       expect(jira.baseOptions.timeout).to.equal(2);
     });
+
+    it('Constructor with strictSSL off', () => {
+      const jira = new JiraApi(
+        getOptions({
+          strictSSL: false,
+        })
+      );
+
+      expect(jira.strictSSL).to.equal(false);
+    });
   });
 
   describe('makeRequestHeader Tests', () => {
Repository: 8398a7/action-slack (ts)
Issue: Limit commit sha to 8 characters
It's too long to show all of them.
Pull request description: [#59] Limit commit sha to 8 characters
close #59

Patch:
diff --git a/src/client.ts b/src/client.ts
index dc0d423..d68eddd 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -39,7 +39,6 @@ export class Client {
 
   constructor(props: With, token?: string, webhookUrl?: string) {
     this.with = props;
-    if (this.with.fields === '') this.with.fields = 'repo,commit';
 
     if (token !== undefined) {
       this.github = new github.GitHub(token);
@@ -175,7 +174,10 @@ export class Client {
 
     return {
       title: 'commit',
-      value: `<https://github.com/${owner}/${repo}/commit/${sha}|${sha}>`,
+      value: `<https://github.com/${owner}/${repo}/commit/${sha}|${sha.slice(
+        0,
+        8,
+      )}>`,
       short: true,
     };
   }
diff --git a/src/main.ts b/src/main.ts
index 64cbb02..baa3e94 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -28,7 +28,6 @@ async function run(): Promise<void> {
     core.debug(`channel: ${channel}`);
     core.debug(`custom_payload: ${custom_payload}`);
     core.debug(`payload: ${payload}`);
-    core.debug(`fields: ${fields}`);
 
     const client = new Client(
       {


Test patch:
diff --git a/__tests__/client.test.ts b/__tests__/client.test.ts
index 2e4c276..769b67f 100644
--- a/__tests__/client.test.ts
+++ b/__tests__/client.test.ts
@@ -38,7 +38,9 @@ const commit = (): Field => {
   return {
     short: true,
     title: 'commit',
-    value: `<https://github.com/8398a7/action-slack/commit/${process.env.GITHUB_SHA}|${process.env.GITHUB_SHA}>`,
+    value: `<https://github.com/8398a7/action-slack/commit/${
+      process.env.GITHUB_SHA
+    }|${process.env.GITHUB_SHA?.slice(0, 8)}>`,
   };
 };
Repository: chezou/tabula-py (python)
Issue: `guess=False` when `stream` or `lattice` is True
Since tabula app works independently between guess, stream, and lattice, it should be better to off when `stream` or `lattice` option is on.
Pull request description: Make stream and lattice exclusive with guess option
Fix #134

Patch:
diff --git a/tabula/wrapper.py b/tabula/wrapper.py
index 254693c..638fd26 100644
--- a/tabula/wrapper.py
+++ b/tabula/wrapper.py
@@ -2,10 +2,6 @@
 
 This module extract tables from PDF into pandas DataFrame. Currently, the
 implementation of this module uses subprocess.
-
-Todo:
-  * Use py4j and handle multiple tables in a page
-
 '''
 
 import io
@@ -439,6 +435,17 @@ def build_options(kwargs=None):
                 __options += ["--area", __area]
 
     guess = kwargs.get('guess', True)
+
+    lattice = kwargs.get('lattice') or kwargs.get('spreadsheet')
+    if lattice:
+        guess = False
+        __options.append("--lattice")
+
+    stream = kwargs.get('stream') or kwargs.get('nospreadsheet')
+    if stream:
+        guess = False
+        __options.append("--stream")
+
     if guess and not multiple_areas:
         __options.append("--guess")
 
@@ -450,14 +457,6 @@ def build_options(kwargs=None):
     if output_path:
         __options += ["--outfile", output_path]
 
-    lattice = kwargs.get('lattice') or kwargs.get('spreadsheet')
-    if lattice:
-        __options.append("--lattice")
-
-    stream = kwargs.get('stream') or kwargs.get('nospreadsheet')
-    if stream:
-        __options.append("--stream")
-
     columns = kwargs.get('columns')
     if columns:
         __columns = ",".join(map(str, columns))


Test patch:
diff --git a/tests/test_read_pdf_table.py b/tests/test_read_pdf_table.py
index d0102b6..cd09dbf 100644
--- a/tests/test_read_pdf_table.py
+++ b/tests/test_read_pdf_table.py
@@ -43,10 +43,10 @@ class TestReadPdfTable(unittest.TestCase):
         expected_csv2 = 'tests/resources/data_2-3.csv'
         expected_df2 = pd.read_csv(expected_csv2)
         self.assertTrue(tabula.read_pdf(pdf_path, pages=1).equals(pd.read_csv(expected_csv1)))
-        self.assertTrue(tabula.read_pdf(pdf_path, pages='2-3', stream=True,
-                                        guess=False).equals(expected_df2))
+        self.assertTrue(tabula.read_pdf(pdf_path, pages='2-3', stream=True).equals(expected_df2))
+        self.assertTrue(tabula.read_pdf(pdf_path, pages=(2, 3), stream=True).equals(expected_df2))
         self.assertTrue(tabula.read_pdf(pdf_path, pages=(2, 3), stream=True,
-                                        guess=False).equals(expected_df2))
+                                        guess=True).equals(expected_df2))
 
     def test_read_pdf_file_like_obj(self):
         pdf_path = 'tests/resources/data.pdf'
Repository: MartinThoma/flake8-simplify (python)
Issue: [Adjust Rule] SIM111 - Detect if another statement comes after the loop
## Desired change

* **Rule(s)**: SIM111
* **Adjustment**: Detect if another statement comes after the loop

## Explanation

The below code is flagged with SIM111, but if I would would use the suggested code, the `call_method` call would be lost.

## Example

```python
for a in my_list:
  if a == 2:
    return False
call_method()
return True
```

Pull request description: SIM111: Fix false-positive
Closes #62

Patch:
diff --git a/flake8_simplify/rules/ast_for.py b/flake8_simplify/rules/ast_for.py
index fcbac36..8d4d984 100644
--- a/flake8_simplify/rules/ast_for.py
+++ b/flake8_simplify/rules/ast_for.py
@@ -97,7 +97,7 @@ def get_sim110_sim111(node: ast.For) -> List[Tuple[int, int, str]]:
         return errors
     if not hasattr(node.body[0].body[0].value, "value"):
         return errors
-    if isinstance(node.next_sibling, ast.Raise):  # type: ignore
+    if not isinstance(node.next_sibling, ast.Return):  # type: ignore
         return errors
     check = to_source(node.body[0].test)
     target = to_source(node.target)


Test patch:
diff --git a/tests/test_100_rules.py b/tests/test_100_rules.py
index 2164e31..fba08fe 100644
--- a/tests/test_100_rules.py
+++ b/tests/test_100_rules.py
@@ -498,3 +498,15 @@ def test_sim120():
     assert results == {
         "1:0 SIM120 Use 'class FooBar:' instead of 'class FooBar(object):'"
     }
+
+
+def test_sim111_false_positive():
+    results = _results(
+        """for a in my_list:
+  if a == 2:
+    return False
+call_method()
+return True"""
+    )
+    for el in results:
+        assert "SIM111" not in el
Repository: spf13/viper (go)
Issue: error on handle corba StringArray flag
I got an error while handle cobra StringArray flag. I think this may be a BUG

``` go
flags.StringArrayP("URLS", "U", []string{"http://github.com", "http://github.com"}, "test URLS")
viper.BindPFlag("URLS", flags.Lookup("URLS"))
Result:=viper.GetStringSlice("URLS")
```

Result is only one element=> 

`Result=[[http://github.com,http://github.com]]`
It should be `[http://github.com http://github.com]`

Pull request description: Add a proper processing for pflag.StringArray
This PR fixes #246 and adds tests to changes from #398.

Please, consider it to merge!

Fixes #246
Fixes #398

Patch:
diff --git a/viper.go b/viper.go
index 60f9868..e8c0462 100644
--- a/viper.go
+++ b/viper.go
@@ -1153,7 +1153,7 @@ func (v *Viper) find(lcaseKey string, flagDefault bool) interface{} {
 			return cast.ToInt(flag.ValueString())
 		case "bool":
 			return cast.ToBool(flag.ValueString())
-		case "stringSlice":
+		case "stringSlice", "stringArray":
 			s := strings.TrimPrefix(flag.ValueString(), "[")
 			s = strings.TrimSuffix(s, "]")
 			res, _ := readAsCSV(s)
@@ -1232,7 +1232,7 @@ func (v *Viper) find(lcaseKey string, flagDefault bool) interface{} {
 				return cast.ToInt(flag.ValueString())
 			case "bool":
 				return cast.ToBool(flag.ValueString())
-			case "stringSlice":
+			case "stringSlice", "stringArray":
 				s := strings.TrimPrefix(flag.ValueString(), "[")
 				s = strings.TrimSuffix(s, "]")
 				res, _ := readAsCSV(s)


Test patch:
diff --git a/viper_test.go b/viper_test.go
index f748c7a..4192748 100644
--- a/viper_test.go
+++ b/viper_test.go
@@ -917,6 +917,54 @@ func TestBindPFlagsStringSlice(t *testing.T) {
 	}
 }
 
+// nolint: dupl
+func TestBindPFlagsStringArray(t *testing.T) {
+	tests := []struct {
+		Expected []string
+		Value    string
+	}{
+		{[]string{}, ""},
+		{[]string{"jeden"}, "jeden"},
+		{[]string{"dwa,trzy"}, "dwa,trzy"},
+		{[]string{"cztery,\"piec , szesc\""}, "cztery,\"piec , szesc\""},
+	}
+
+	v := New() // create independent Viper object
+	defaultVal := []string{"default"}
+	v.SetDefault("stringarray", defaultVal)
+
+	for _, testValue := range tests {
+		flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError)
+		flagSet.StringArray("stringarray", testValue.Expected, "test")
+
+		for _, changed := range []bool{true, false} {
+			flagSet.VisitAll(func(f *pflag.Flag) {
+				f.Value.Set(testValue.Value)
+				f.Changed = changed
+			})
+
+			err := v.BindPFlags(flagSet)
+			if err != nil {
+				t.Fatalf("error binding flag set, %v", err)
+			}
+
+			type TestStr struct {
+				StringArray []string
+			}
+			val := &TestStr{}
+			if err := v.Unmarshal(val); err != nil {
+				t.Fatalf("%+#v cannot unmarshal: %s", testValue.Value, err)
+			}
+			if changed {
+				assert.Equal(t, testValue.Expected, val.StringArray)
+				assert.Equal(t, testValue.Expected, v.Get("stringarray"))
+			} else {
+				assert.Equal(t, defaultVal, val.StringArray)
+			}
+		}
+	}
+}
+
 // nolint: dupl
 func TestBindPFlagsIntSlice(t *testing.T) {
 	tests := []struct {