internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ansible/ansible

Issue:
when using (wrong) simple format for vars_files, 1.9.x error is clearer than 2.0
##### Issue Type:
- Bug Report
##### Ansible Version:

```
ansible 2.0.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
```

##### COMPONENT NAME
variable parser

##### Ansible Configuration:

nothing of note
##### Environment:

Fedora 23
##### Summary:

Ansible's error message when using the wrong specifier for vars_files is much clearer on 1.9.x than 2.0.
##### Steps To Reproduce:

Take the following playbook:

```
- hosts: all
  vars_files: "vulnerable.yml"
```

Output when running on 1.9.x:

```
$ ansible-playbook -c local cow.yml
ERROR: vars_files must be a list
```

Output when running on 2.0.x:

```
$ ansible-playbook  -c local cow.yml
 [WARNING]: provided hosts list is empty, only localhost is available

ERROR! vars file v was not found
```
##### Expected Results:

2.0 error, while logical if it's interpreting is the string as a list, isn't very clear.
##### Actual Results:

2.0 error is as clear as the 1.9.x error.



Discussion:
@wenottingham Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. 

Here are the items we could not find in your description:
- component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: issue_missing_data --->

Resolving patch:
diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py
--- a/lib/ansible/playbook/play.py
+++ b/lib/ansible/playbook/play.py
@@ -286,6 +286,8 @@ def get_vars(self):
     def get_vars_files(self):
         if self.vars_files is None:
             return []
+        elif not isinstance(self.vars_files, list):
+            return [self.vars_files]
         return self.vars_files
 
     def get_handlers(self):


Test patch:
Repository: ansible/ansible

Issue:
meraki_network has status of changed when it shouldn't be
##### SUMMARY
The `meraki_network` module shouldn't show task status of changed when no changes are made to a network. Currently, it seems to be showing status of changed.

##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
meraki_network

##### ANSIBLE VERSION
```
ansible 2.7.0.dev0 (meraki/meraki_vlan 2ecf1d35d3) last updated 2018/06/10 19:28:02 (GMT -500)
  config file = None
  configured module search path = ['/Users/kbreit/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/kbreit/Documents/Programming/ansible/lib/ansible
  executable location = /Users/kbreit/Documents/Programming/ansible/bin/ansible
  python version = 3.5.4 (default, Feb 25 2018, 14:56:02) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
```


Discussion:
Files identified in the description:
* [lib/ansible/modules/network/meraki/meraki_network.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/meraki/meraki_network.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @dagwieers
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Note - This seems to be happening when running `meraki_ssid` integration test during failure.

Resolving patch:
diff --git a/lib/ansible/modules/network/meraki/meraki_network.py b/lib/ansible/modules/network/meraki/meraki_network.py
--- a/lib/ansible/modules/network/meraki/meraki_network.py
+++ b/lib/ansible/modules/network/meraki/meraki_network.py
@@ -184,11 +184,14 @@ def main():
     if meraki.params['state'] == 'present':
         payload = {'name': meraki.params['net_name'],
                    'type': meraki.params['type'],
+                   'tags': meraki.params['tags'],
                    }
         if meraki.params['tags']:
             payload['tags'] = construct_tags(meraki.params['tags'])
         if meraki.params['timezone']:
             payload['timeZone'] = meraki.params['timezone']
+        else:
+            payload['timeZone'] = 'America/Los_Angeles'
         if meraki.params['type'] == 'combined':
             payload['type'] = 'switch wireless appliance'
 


Test patch:
Repository: ansible/ansible

Issue:
file: Module bails out when file unexpectedly disappears
##### SUMMARY
Ansible file module bails out when file to be removed unexpectedly disappears while running.

```python
        Traceback (most recent call last):
          File "/tmp/ansible_hWZCOr/ansible_module_file.py", line 739, in <module>
            main()
          File "/tmp/ansible_hWZCOr/ansible_module_file.py", line 707, in main
            additional_parameter_handling(module.params)
          File "/tmp/ansible_hWZCOr/ansible_module_file.py", line 185, in additional_parameter_handling
            prev_state = get_state(to_bytes(params['path'], errors='surrogate_or_strict'))
          File "/tmp/ansible_hWZCOr/ansible_module_file.py", line 220, in get_state
            elif os.stat(b_path).st_nlink > 1:
        OSError: [Errno 2] No such file or directory: '/home/ccla/.ssh/known_hosts'
```

##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
file

##### ANSIBLE VERSION
v2.7 and older



Discussion:
Files identified in the description:
* [lib/ansible/modules/files/file.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/file.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Resolving patch:
diff --git a/lib/ansible/modules/files/file.py b/lib/ansible/modules/files/file.py
--- a/lib/ansible/modules/files/file.py
+++ b/lib/ansible/modules/files/file.py
@@ -33,7 +33,7 @@
 options:
   path:
     description:
-      - 'path to the file being managed.  Aliases: I(dest), I(name)'
+      - Path to the file being managed.
     required: true
     aliases: [ dest, name ]
   state:
@@ -212,18 +212,24 @@ def get_state(path):
     ''' Find out current state '''
 
     b_path = to_bytes(path, errors='surrogate_or_strict')
-    if os.path.lexists(b_path):
-        if os.path.islink(b_path):
-            return 'link'
-        elif os.path.isdir(b_path):
-            return 'directory'
-        elif os.stat(b_path).st_nlink > 1:
-            return 'hard'
-
-        # could be many other things, but defaulting to file
-        return 'file'
-
-    return 'absent'
+    try:
+        if os.path.lexists(b_path):
+            if os.path.islink(b_path):
+                return 'link'
+            elif os.path.isdir(b_path):
+                return 'directory'
+            elif os.stat(b_path).st_nlink > 1:
+                return 'hard'
+
+            # could be many other things, but defaulting to file
+            return 'file'
+
+        return 'absent'
+    except OSError as e:
+        if e.errno == errno.ENOENT:  # It may already have been removed
+            return 'absent'
+        else:
+            raise
 
 
 # This should be moved into the common file utilities


Test patch:
Repository: ansible/ansible

Issue:
Misleading error from ansible-galaxy if 'git' is missing
##### SUMMARY

When using ansible galaxy with a missing git binary, the error message is very misleading:

```
ERROR! Unexpected Exception, this is probably a bug: local variable 'stdout' referenced before assignment
``` 

##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
ansible-galaxy

##### ANSIBLE VERSION

```
2.6.1
```

##### CONFIGURATION

##### OS / ENVIRONMENT
N/A
##### STEPS TO REPRODUCE
use a system without git binary installed, need a proper `requirements` file
```
ansible-galaxy install -r requirements.txt
```

##### EXPECTED RESULTS
`git not found` or similar

##### ACTUAL RESULTS
```
ERROR! Unexpected Exception, this is probably a bug: local variable 'stdout' referenced before assignment
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/playbook/role/requirement.py b/lib/ansible/playbook/role/requirement.py
--- a/lib/ansible/playbook/role/requirement.py
+++ b/lib/ansible/playbook/role/requirement.py
@@ -189,6 +189,8 @@ def scm_archive_role(src, scm='git', name=None, version='HEAD', keep_scm_meta=Fa
 
         def run_scm_cmd(cmd, tempdir):
             try:
+                stdout = ''
+                stderr = ''
                 popen = Popen(cmd, cwd=tempdir, stdout=PIPE, stderr=PIPE)
                 stdout, stderr = popen.communicate()
             except Exception as e:


Test patch:
Repository: ansible/ansible

Issue:
get_url docs specifies return var 'status' which actually is 'status_code'
##### SUMMARY
The docs for get_url describe as one of the return variables:

```status; always; the HTTP status code from the request```

This will never be returned; the source code doesn't return it. What it should specify is:

```status_code; always; the HTTP status code from the request```

##### ISSUE TYPE
 - Documentation Report

##### COMPONENT NAME
get_url

##### ANSIBLE VERSION
devel

##### CONFIGURATION


##### OS / ENVIRONMENT
N/A
##### STEPS TO REPRODUCE
Seen in documentation

##### EXPECTED RESULTS

##### ACTUAL RESULTS



Discussion:
Files identified in the description:
* [lib/ansible/modules/net_tools/basics/get_url.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/net_tools/basics/get_url.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @jpmens
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/net_tools/basics/get_url.py b/lib/ansible/modules/net_tools/basics/get_url.py
--- a/lib/ansible/modules/net_tools/basics/get_url.py
+++ b/lib/ansible/modules/net_tools/basics/get_url.py
@@ -269,7 +269,7 @@
     returned: success
     type: string
     sample: file
-status:
+status_code:
     description: the HTTP status code from the request
     returned: always
     type: int


Test patch:
Repository: ansible/ansible

Issue:
Wrong error message if a filter is used in conditions and custom filter_plugins have errors
##### SUMMARY
If filter_plugins contains a custom filter that fails to load and a filter is used in a condition, the root error cause is not displayed. Instead ansible complains about a missing filter.

##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
core

##### ANSIBLE VERSION
```
2.6.1
```

##### CONFIGURATION
unchanged

##### OS / ENVIRONMENT
N/A

##### STEPS TO REPRODUCE
* Create a simple playbook that runs a buildin filter in a condition. Example:
```
- hosts: all
  tasks:
    - fail: msg="test"
      when: " {{ 0|bool }}"
```
* Verify that the playbook works (i.e. the "fail" task is skipped)
* Create a directory filter_plugins at the same level as the playbook
* put a custom filter file to that directory that produces a load error (e.g. with an invalid import)
```
mkdir -p filter_plugins
echo "import no_such_thing" > filter_plugins/custom.py
```
* re-run the playbook


##### EXPECTED RESULTS
Either a warning or an error that filter_plugins/custom.py cannot be loaded because of ModuleNotFoundError: No module named 'no_such_thing'

##### ACTUAL RESULTS
There's no warning about the broken custom filter file but all builtin filters are broken:
```
FAILED! => {"msg": "The conditional check ' {{ 0|bool }}' failed. The error was: template error while templating string: no filter named 'bool'. String:  {{ 0|bool }}
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py
--- a/lib/ansible/plugins/loader.py
+++ b/lib/ansible/plugins/loader.py
@@ -486,7 +486,10 @@ def all(self, *args, **kwargs):
                 continue
 
             if path not in self._module_cache:
-                module = self._load_module_source(name, path)
+                try:
+                    module = self._load_module_source(name, path)
+                except Exception as e:
+                    display.warning("Skipping plugin (%s) as it seems to be invalid: %s" % (path, to_text(e)))
                 self._module_cache[path] = module
                 found_in_cache = False
 


Test patch:
Repository: intel/dffml

Issue:
model: scikit: setup.py needs correct entrypoints
```diff
diff --git a/model/scikit/setup.py b/model/scikit/setup.py
index 1bd6284..efbff80 100644
--- a/model/scikit/setup.py
+++ b/model/scikit/setup.py
@@ -57,5 +57,9 @@ setup(
     ],
     install_requires=INSTALL_REQUIRES,
     packages=find_packages(),
-    entry_points={"dffml.model": [f"scikitlr = {IMPORT_NAME}.sciLR:LR"]},
+    entry_points={"dffml.model": [
+        f"scikitmlp = {IMPORT_NAME}.scikit_models:MLPClassifierModel",
+        f"scikitmlp = {IMPORT_NAME}.scikit_models:MLPClassifierModel",
+        f"scikitmlp = {IMPORT_NAME}.scikit_models:MLPClassifierModel",
+        ]},
 )
```


Discussion:

Resolving patch:
diff --git a/model/scikit/setup.py b/model/scikit/setup.py
--- a/model/scikit/setup.py
+++ b/model/scikit/setup.py
@@ -53,5 +53,18 @@
     ],
     install_requires=INSTALL_REQUIRES,
     packages=find_packages(),
-    entry_points={"dffml.model": [f"scikitlr = {IMPORT_NAME}.sciLR:LR"]},
+    entry_points={
+        "dffml.model": [
+            f"scikitknn = {IMPORT_NAME}.scikit_models:KNeighborsClassifier",
+            f"scikitadaboost = {IMPORT_NAME}.scikit_models:AdaBoostClassifier",
+            f"scikitgpc = {IMPORT_NAME}.scikit_models:GaussianProcessClassifier",
+            f"scikitdtc = {IMPORT_NAME}.scikit_models:DecisionTreeClassifier",
+            f"scikitrfc = {IMPORT_NAME}.scikit_models:RandomForestClassifier",
+            f"scikitmlp = {IMPORT_NAME}.scikit_models:MLPClassifier",
+            f"scikitgnb = {IMPORT_NAME}.scikit_models:GaussianNB",
+            f"scikitqda = {IMPORT_NAME}.scikit_models:QuadraticDiscriminantAnalysis",
+            f"scikitsvc = {IMPORT_NAME}.scikit_models:SVC",
+            f"scikitlr = {IMPORT_NAME}.scikit_models:LinearRegression",
+        ]
+    },
 )


Test patch:
Repository: intel/dffml

Issue:
docs: Switch HTML theme to sphinx_rtd_theme
https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -57,7 +57,7 @@
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = "alabaster"
+html_theme = "sphinx_rtd_theme"
 
 html_theme_options = {
     "description": "The fastest path to machine learning integration",
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -49,6 +49,7 @@
             "sphinx",
             "sphinxcontrib-asyncio",
             "black",
+            "sphinx_rtd_theme",
         ],
     },
     entry_points={


Test patch:
Repository: intel/dffml

Issue:
model: scikit: Missing space between label and for
https://github.com/intel/dffml/blob/3791f76d802fe6f3a63f9991c8b5b4afde6f7c76/model/scikit/dffml_model_scikit/scikit_models.py#L217

No changelog change needed on the one.


Discussion:

Resolving patch:
diff --git a/model/scikit/dffml_model_scikit/__init__.py b/model/scikit/dffml_model_scikit/__init__.py
--- a/model/scikit/dffml_model_scikit/__init__.py
+++ b/model/scikit/dffml_model_scikit/__init__.py
@@ -320,7 +320,7 @@
         model,
         {"Col1": 6.09809669, "Col2": 8.36434181, "Col3": 6.70940915, "Col4": -7.91491768},
     ):
-        features["cluster"] = prediction["Prediction"]["value"]
+        features["cluster"] = prediction["cluster"]["value"]
         print(features)
 
 **NOTE**: `Transductive <https://scikit-learn.org/stable/glossary.html#term-transductive/>`_ Clusterers(scikitsc, scikitac, scikitoptics) cannot handle unseen data.
diff --git a/model/scikit/dffml_model_scikit/scikit_models.py b/model/scikit/dffml_model_scikit/scikit_models.py
--- a/model/scikit/dffml_model_scikit/scikit_models.py
+++ b/model/scikit/dffml_model_scikit/scikit_models.py
@@ -214,7 +214,7 @@ def applicable_features(self, features):
         config_fields["tcluster"] = (
             Feature,
             field(
-                "True cluster labelfor evaluating clustering models",
+                "True cluster label for evaluating clustering models",
                 default=None,
             ),
         )
@@ -241,8 +241,8 @@ def applicable_features(self, features):
         dffml_config_properties["predict"] = (
             Feature,
             field(
-                "field here for compability with other functions,no need to change",
-                default=DefFeature(name="Prediction", dtype="str", length=10),
+                "Name used as meaning of prediction",
+                default=DefFeature(name="cluster", dtype="str", length=10),
             ),
         )
 


Test patch:
diff --git a/model/scikit/tests/test_scikit_integration.py b/model/scikit/tests/test_scikit_integration.py
--- a/model/scikit/tests/test_scikit_integration.py
+++ b/model/scikit/tests/test_scikit_integration.py
@@ -339,8 +339,8 @@ async def test_run(self):
             results = results[0]
             self.assertIn("prediction", results)
             results = results["prediction"]
-            self.assertIn("Prediction", results)
-            results = results["Prediction"]
+            self.assertIn("cluster", results)
+            results = results["cluster"]
             self.assertIn("value", results)
             results = results["value"]
             self.assertTrue(results is not None)
Repository: intel/dffml

Issue:
operation: io: Examples not being run
Due to the lack of newline between the sentence in the examples section and the python prompt. The sphinx doctest plugin isn't running the examples for the IO operations.

https://github.com/intel/dffml/blob/b20e40ea444e9e6091d7702895ab242e33312da8/dffml/operation/io.py#L54-L55

https://github.com/intel/dffml/blob/b20e40ea444e9e6091d7702895ab242e33312da8/dffml/operation/io.py#L108-L109

Also, to make the call to `input` return the desired value, we probably need to modify `docs/doctest_header.py` to use `uinttest.mock.patch` in a similar way to the tests, but instead use the `.start()` call (no need to use `.stop()`)

https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch

```
>>> Original = Class
>>> patcher = patch('__main__.Class', spec=True)
>>> MockClass = patcher.start()
>>> instance = MockClass()
>>> assert isinstance(instance, Original)
>>> patcher.stop()
```


Discussion:
Ping @0dust 

Resolving patch:
diff --git a/dffml/operation/io.py b/dffml/operation/io.py
--- a/dffml/operation/io.py
+++ b/dffml/operation/io.py
@@ -52,6 +52,7 @@ class AcceptUserInput(OperationImplementation):
     ++++++++
 
     The following example shows how to use AcceptUserInput.
+
     >>> dataflow = DataFlow.auto(AcceptUserInput, GetSingle)
     >>> dataflow.seed.append(
     ...     Input(
@@ -106,6 +107,7 @@ async def print_output(data: str):
     ++++++++
 
     The following example shows how to use print_output.
+
     >>> dataflow = DataFlow.auto(print_output, GetSingle)
     >>> inputs = [
     ...     Input(
@@ -121,4 +123,4 @@ async def print_output(data: str):
     print_output example
     String to be printed is 'print_output example'
     """
-    print("\n" + data)
+    print(data)
diff --git a/docs/doctest_header.py b/docs/doctest_header.py
--- a/docs/doctest_header.py
+++ b/docs/doctest_header.py
@@ -7,7 +7,9 @@
 import inspect
 import asyncio
 import tempfile
+import builtins
 import functools
+from unittest import mock
 
 # Create a temporary directory for test to run in
 DOCTEST_TEMPDIR = tempfile.mkdtemp()
@@ -16,14 +18,18 @@
 # Change the current working directory to the temporary directory
 os.chdir(DOCTEST_TEMPDIR)
 
-from dffml_model_scikit import *
 from dffml import *
 from dffml.base import *
 from dffml.record import *
 from dffml.df.base import *
 from dffml.df.types import *
-from dffml.df.memory import *
 from dffml.util.net import *
+from dffml.df.memory import *
+from dffml_model_scikit import *
+from dffml.operation.io import *
+from dffml.source.memory import *
 from dffml.operation.output import *
 from dffml.operation.dataflow import *
-from dffml.source.memory import *
+
+# Used for mocking input() for AcceptUserInput operation.
+mock.patch("builtins.input", return_value="Data flow is awesome").start()


Test patch:
Repository: intel/dffml

Issue:
docs: Enable hiding of Python prompts
This will be very helpful for copy pasting examples.

References:
- https://github.com/readthedocs/sphinx_rtd_theme/issues/167


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -87,6 +87,11 @@
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ["_static"]
 
+
+def setup(app):
+    app.add_javascript("copybutton.js")
+
+
 # -- Extension configuration -------------------------------------------------
 
 napoleon_numpy_docstring = True


Test patch: