PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: vaskoz/dailycodingproblem-go (go)
Issue: Day 14
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

The area of a circle is defined as πr^2. Estimate π to 3 decimal places using a Monte Carlo method.

Hint: The basic equation of a circle is x^2 + y^2 = r^2.
Pull request description: day 14 solution. based on randomization so there is a chance of test …
…failure

Resolves #31 

Patch:
diff --git a/README.md b/README.md
index c2c490e..e75b4d3 100644
--- a/README.md
+++ b/README.md
@@ -24,3 +24,4 @@ problems from
 * [Day 12](https://github.com/vaskoz/dailycodingproblem-go/issues/25)
 * [Day 12 Count and Deepest](https://github.com/vaskoz/dailycodingproblem-go/issues/27)
 * [Day 13](https://github.com/vaskoz/dailycodingproblem-go/issues/29)
+* [Day 14](https://github.com/vaskoz/dailycodingproblem-go/issues/31)
diff --git a/day14/problem.go b/day14/problem.go
new file mode 100644
index 0000000..9cd144f
--- /dev/null
+++ b/day14/problem.go
@@ -0,0 +1,20 @@
+package day14
+
+import (
+	"math/rand"
+	"time"
+)
+
+// EstimatePi uses monte carlo simulation to estimate PI.
+func EstimatePi(iterations int) float64 {
+	rand.Seed(time.Now().UnixNano())
+	var inCircle, total int
+	for total = 0; total < iterations; total++ {
+		x := rand.Float64()
+		y := rand.Float64()
+		if x*x+y*y <= 1 {
+			inCircle++
+		}
+	}
+	return 4.0 * float64(inCircle) / float64(total)
+}


Test patch:
diff --git a/day14/problem_test.go b/day14/problem_test.go
new file mode 100644
index 0000000..27dcc46
--- /dev/null
+++ b/day14/problem_test.go
@@ -0,0 +1,33 @@
+package day14
+
+import (
+	"math"
+	"testing"
+)
+
+var testcases = []struct {
+	iterations int
+	expected   float64
+	delta      float64
+}{
+	{100000, 3.1415, 0.1},
+	{10000, 3.1415, 0.1},
+	{1000, 3.1415, 0.1},
+}
+
+func TestEstimatePi(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if pi := EstimatePi(tc.iterations); math.Abs(pi-tc.expected) > tc.delta {
+			t.Errorf("Expected %v but got %v with delta %v", tc.expected, pi, tc.delta)
+		}
+	}
+}
+
+func BenchmarkEstimatePi(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			EstimatePi(tc.iterations)
+		}
+	}
+}
Repository: timothycrosley/isort (python)
Issue: 4.3.16 failing file check after isort
test.py

Before isort ->
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
```

After isort ->
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# FUTURE
from __future__ import unicode_literals
```

isort -c test.py ->
```
ERROR: bla-bla-bla/test.py Imports are incorrectly sorted.
```

isort -df test.py ->
```
--- bla-bla-bla/test.py:before 2019-03-29 21:21:31.371673
+++ bla-bla-bla/test.py:after  2019-03-30 11:43:43.791501
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # FUTURE
+# FUTURE
 from __future__ import unicode_literals
```

Here's settings:
```
[settings]
known_future_library=future
import_heading_future=FUTURE
sections=FUTURE,STDLIB,NORDIGEN,FIRSTPARTY,THIRDPARTY,LOCALFOLDER
indent='    '
multi_line_output=3
lines_after_imports=2
```

Is this a bug or I'm doing something wrong and I can be changed thru settings?
Thanks.
Pull request description: Feature/fix issue 916
Fixes #916 

Patch:
diff --git a/isort/isort.py b/isort/isort.py
index 5757c009..7609648e 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -884,7 +884,7 @@ class SortImports(object):
             self._in_top_comment = True
             return True
         elif self._in_top_comment:
-            if not line.startswith("#"):
+            if not line.startswith("#") or line in self._section_comments:
                 self._in_top_comment = False
                 self._first_comment_index_end = self.index - 1
 


Test patch:
diff --git a/test_isort.py b/test_isort.py
index a729139b..7c42e84c 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -2961,3 +2961,22 @@ def test_settings_path_skip_issue_909(tmpdir):
     os.chdir(str(test_run_directory))
 
     assert b'skipped 2' in results.lower()
+
+
+def test_failing_file_check_916():
+    test_input = ('#!/usr/bin/env python\n'
+                  '# -*- coding: utf-8 -*-\n'
+                  'from __future__ import unicode_literals\n')
+    expected_output = ('#!/usr/bin/env python\n'
+                       '# -*- coding: utf-8 -*-\n'
+                       '# FUTURE\n'
+                       'from __future__ import unicode_literals\n')
+    settings = {'known_future_library': 'future',
+                'import_heading_future': 'FUTURE',
+                'sections': ['FUTURE', 'STDLIB', 'NORDIGEN', 'FIRSTPARTY', 'THIRDPARTY', 'LOCALFOLDER'],
+                'indent': '    ',
+                'multi_line_output': 3,
+                'lines_after_imports': 2}
+    assert SortImports(file_contents=test_input, **settings).output == expected_output
+    assert SortImports(file_contents=expected_output, **settings).output == expected_output
+    assert not SortImports(file_contents=expected_output, check=True, **settings).incorrectly_sorted
Repository: s-knibbs/dataclasses-jsonschema (python)
Issue: Any type should generate an empty field schema
The following definition:

```py
@dataclass
class Parameter(JsonSchemaMixin):

    id: str
    type: ParameterTypeEnum
    value: Any
```

leads to schema like this:

```py
{'type': 'object', 'required': ['id', 'type', 'value'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string', 'enum': ['string', 'double']}, 'value': {'type': 'object'}}}
```

But I would rather see:

```py
{'type': 'object', 'required': ['id', 'type', 'value'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string', 'enum': ['string', 'double']}, 'value': {}}}
```

...where ```type``` for ```value``` is ommited, which means that ```value``` could be data of any type (string or number in this case). Is there a way how to achieve it? Many thanks.
Pull request description: Now generate an empty schema for the `Any` type
Fixes #100 

Patch:
diff --git a/dataclasses_jsonschema/__init__.py b/dataclasses_jsonschema/__init__.py
index 8b79677..8d3e789 100644
--- a/dataclasses_jsonschema/__init__.py
+++ b/dataclasses_jsonschema/__init__.py
@@ -532,7 +532,7 @@ class JsonSchemaMixin:
 
     @classmethod
     def _get_field_schema(cls, field: Union[Field, Type], schema_type: SchemaType) -> Tuple[JsonDict, bool]:
-        field_schema: JsonDict = {'type': 'object'}
+        field_schema: JsonDict = {}
         required = True
 
         if isinstance(field, Field):


Test patch:
diff --git a/tests/test_core.py b/tests/test_core.py
index dc7041b..45b3532 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4,7 +4,7 @@ from enum import Enum
 
 from dataclasses import dataclass, field
 from ipaddress import IPv4Address, IPv6Address
-from typing import List, NewType, Optional, Union, Set
+from typing import List, NewType, Optional, Union, Set, Any
 from typing_extensions import Final, Literal
 from uuid import UUID
 
@@ -747,3 +747,22 @@ def test_set_decode_encode():
     assert isinstance(expected_blog.to_dict()["tags"], list)
     assert len(expected_blog.to_dict()["tags"]) == 2
     assert BlogArticle.from_dict(expected_blog_dict) == expected_blog
+
+
+def test_any_type_schema():
+    @dataclass
+    class GraphNode(JsonSchemaMixin):
+        """A graph node"""
+        id: int
+        data: Any
+
+    expected_schema = compose_schema({
+        "type": "object",
+        "description": "A graph node",
+        "properties": {
+            "id": {"type": "integer"},
+            "data": {}
+        },
+        "required": ["id", "data"]
+    })
+    assert GraphNode.json_schema() == expected_schema
Repository: lesshint/lesshint (js)
Issue: Operators shouldnt be preceded and  followed by one space if this operator is not an operator but just a char.
**Which version of `lesshint` are you using?**

last one

**How are you running `lesshint`? CLI, Node.js API, Grunt/Gulp plugin?**

gulp-lesslint

**What's your `.lesshintrc` configuration?**

vanilla

**If you're reporting a bug, please show us some code that's failing.**

```less
        margin-right: -(@grid-gutter-width / 4);
```

**What did you expect to happen?**

    {nothing}

**What's the actual result?**

    Warning: tables.less: line 13, col 25, spaceAroundOperator: Operators should be preceded and followed by one space.

**Would you be interested in submitting a PR for this issue?**

Why not


----

alternativ:

`@grid-whatever-width` shouldn't be allowed as name at all...

Pull request description: Allow negative values before a (. Close #349
**Which issue, if any, does this resolve?**
Solve #349 

```css
h {
    margin-left: -(1px); // fails
}
```
**Is there anything in this PR that needs extra explaining or should something specific be focused on?**

Nope. A lot of copy/paste code in the test section.

I am not sure about my changes. Any help is welcome!

Patch:
diff --git a/lib/linters/space_around_operator.js b/lib/linters/space_around_operator.js
index 830763e..1038e13 100644
--- a/lib/linters/space_around_operator.js
+++ b/lib/linters/space_around_operator.js
@@ -24,12 +24,12 @@ module.exports = {
             const nextElement = child.parent.nodes[index + 1];
             const prevElement = child.parent.nodes[index - 1];
 
+
             // Ignore negative numbers
             if (child.value === '-' && (child.raws.before || node.raws.between) &&
-                nextElement.type === 'number' && !nextElement.raws.before) {
+                (nextElement.type === 'number' || nextElement.value === '(') && !nextElement.raws.before) {
                 return;
             }
-
             // Ignore variables
             if (child.value === '-' && (child.raws.before || node.raws.between) &&
                 nextElement.type === 'atword' && !nextElement.raws.before) {


Test patch:
diff --git a/test/specs/linters/space_around_operator.js b/test/specs/linters/space_around_operator.js
index d67819e..6578500 100644
--- a/test/specs/linters/space_around_operator.js
+++ b/test/specs/linters/space_around_operator.js
@@ -84,6 +84,16 @@ describe('lesshint', function () {
                 });
             });
 
+            it('should not report on negative values before a (', function () {
+                const source = 'margin-left: -(10px);';
+
+                return spec.parse(source, function (ast) {
+                    const result = spec.linter.lint(options, ast.root.first);
+
+                    expect(result).to.be.undefined;
+                });
+            });
+
             it('should not report on negative values in shorthands', function () {
                 const source = 'margin: -10px -1px 0px 20px;';