We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
basestring
Hi there
I found the following issue:
If I'm using the F1 object from rootpy.plotting and try to access a parameter using [parnr] (the __getitem__) methode, I get the following error:
`NameError: name 'basestring' is not defined`
I'm using python 3.6 which doesn't has the basestring data type anymore..

https://github.com/rootpy/rootpy/blob/457e074056a916fff848978ef68b7f5107856e47/rootpy/plotting/func.py#L63

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `rootpy/plotting/func.py`
Content:
```
1 from __future__ import absolute_import
2 
3 from .. import QROOT
4 from ..decorators import snake_case_methods
5 from .base import Plottable
6 from ..base import NameOnlyObject
7 
8 
9 __all__ = [
10     'F1',
11     'F2',
12     'F3',
13 ]
14 
15 class BaseFunction(object):
16     class ParProxy(object):
17         def __init__(self, fcn, idx):
18             self.fcn_ = fcn
19             self.idx_ = idx
20         
21         @property
22         def index(self):
23             return self.idx_
24 
25         @property
26         def name(self):
27             return self.fcn_.GetParName(self.idx_)
28         
29         @name.setter
30         def name(self, val):
31             return self.fcn_.SetParName(self.idx_, val)
32 
33         @property
34         def value(self):
35             return self.fcn_.GetParameter(self.idx_)
36 
37         @value.setter
38         def value(self, val):
39             self.fcn_.SetParameter(self.idx_, val)
40 
41         @property
42         def error(self):
43             return self.fcn_.GetParError(self.idx_)
44 
45         @error.setter
46         def error(self, val):
47             return self.fcn_.SetParError(self.idx_, val)
48 
49         @property
50         def limits(self):
51             m = QROOT.Double()
52             M = QROOT.Double()
53             self.fcn_.GetParLimits(self.idx_, m, M)
54             return float(m), float(M)
55 
56         @limits.setter
57         def limits(self, val):
58             if not hastattr(val, '__len__') and len(val) != 2:
59                 raise RuntimeError('Function limits must be a tuple size 2')
60             self.fcn_.SetParLimits(self.idx_, val[0], val[1])
61 
62     def __getitem__(self, value):
63         if isinstance(value, basestring):
64             idx = self.GetParNumber(value)
65         elif isinstance(value, int):
66             idx = value
67         else:
68             raise ValueError('Function index must be a integer or a string')
69         return BaseFunction.ParProxy(self, idx)
70 
71 
72 @snake_case_methods
73 class F1(Plottable, NameOnlyObject, BaseFunction, QROOT.TF1):
74     _ROOT = QROOT.TF1
75 
76     def __init__(self, *args, **kwargs):
77         name = kwargs.pop('name', None)
78         super(F1, self).__init__(*args, name=name)
79         self._post_init(**kwargs)
80 
81 
82 @snake_case_methods
83 class F2(Plottable, NameOnlyObject, BaseFunction, QROOT.TF2):
84     _ROOT = QROOT.TF2
85 
86     def __init__(self, *args, **kwargs):
87         name = kwargs.pop('name', None)
88         super(F2, self).__init__(*args, name=name)
89         self._post_init(**kwargs)
90 
91 
92 @snake_case_methods
93 class F3(Plottable, NameOnlyObject, BaseFunction, QROOT.TF3):
94     _ROOT = QROOT.TF3
95 
96     def __init__(self, *args, **kwargs):
97         name = kwargs.pop('name', None)
98         super(F3, self).__init__(*args, name=name)
99         self._post_init(**kwargs)
100
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/rootpy/plotting/func.py b/rootpy/plotting/func.py
--- a/rootpy/plotting/func.py
+++ b/rootpy/plotting/func.py
@@ -4,7 +4,7 @@
 from ..decorators import snake_case_methods
 from .base import Plottable
 from ..base import NameOnlyObject
-
+import six
 
 __all__ = [
     'F1',
@@ -17,7 +17,7 @@
         def __init__(self, fcn, idx):
             self.fcn_ = fcn
             self.idx_ = idx
-        
+
         @property
         def index(self):
             return self.idx_
@@ -25,7 +25,7 @@
         @property
         def name(self):
             return self.fcn_.GetParName(self.idx_)
-        
+
         @name.setter
         def name(self, val):
             return self.fcn_.SetParName(self.idx_, val)
@@ -55,14 +55,14 @@
 
         @limits.setter
         def limits(self, val):
-            if not hastattr(val, '__len__') and len(val) != 2:
+            if not hasattr(val, '__len__') and len(val) != 2:
                 raise RuntimeError('Function limits must be a tuple size 2')
             self.fcn_.SetParLimits(self.idx_, val[0], val[1])
 
     def __getitem__(self, value):
-        if isinstance(value, basestring):
+        if isinstance(value, six.string_types):
             idx = self.GetParNumber(value)
-        elif isinstance(value, int):
+        elif isinstance(value, six.integer_types):
             idx = value
         else:
             raise ValueError('Function index must be a integer or a string')

{"golden_diff": "diff --git a/rootpy/plotting/func.py b/rootpy/plotting/func.py\n--- a/rootpy/plotting/func.py\n+++ b/rootpy/plotting/func.py\n@@ -4,7 +4,7 @@\n from ..decorators import snake_case_methods\n from .base import Plottable\n from ..base import NameOnlyObject\n-\n+import six\n \n __all__ = [\n     'F1',\n@@ -17,7 +17,7 @@\n         def __init__(self, fcn, idx):\n             self.fcn_ = fcn\n             self.idx_ = idx\n-        \n+\n         @property\n         def index(self):\n             return self.idx_\n@@ -25,7 +25,7 @@\n         @property\n         def name(self):\n             return self.fcn_.GetParName(self.idx_)\n-        \n+\n         @name.setter\n         def name(self, val):\n             return self.fcn_.SetParName(self.idx_, val)\n@@ -55,14 +55,14 @@\n \n         @limits.setter\n         def limits(self, val):\n-            if not hastattr(val, '__len__') and len(val) != 2:\n+            if not hasattr(val, '__len__') and len(val) != 2:\n                 raise RuntimeError('Function limits must be a tuple size 2')\n             self.fcn_.SetParLimits(self.idx_, val[0], val[1])\n \n     def __getitem__(self, value):\n-        if isinstance(value, basestring):\n+        if isinstance(value, six.string_types):\n             idx = self.GetParNumber(value)\n-        elif isinstance(value, int):\n+        elif isinstance(value, six.integer_types):\n             idx = value\n         else:\n             raise ValueError('Function index must be a integer or a string')\n", "issue": "basestring\nHi there\r\nI found the following issue:\r\nIf I'm using the F1 object from rootpy.plotting and try to access a parameter using [parnr] (the __getitem__) methode, I get the following error:\r\n`NameError: name 'basestring' is not defined`\r\nI'm using python 3.6 which doesn't has the basestring data type anymore..\r\n\r\nhttps://github.com/rootpy/rootpy/blob/457e074056a916fff848978ef68b7f5107856e47/rootpy/plotting/func.py#L63\n", "before_files": [{"content": "from __future__ import absolute_import\n\nfrom .. import QROOT\nfrom ..decorators import snake_case_methods\nfrom .base import Plottable\nfrom ..base import NameOnlyObject\n\n\n__all__ = [\n    'F1',\n    'F2',\n    'F3',\n]\n\nclass BaseFunction(object):\n    class ParProxy(object):\n        def __init__(self, fcn, idx):\n            self.fcn_ = fcn\n            self.idx_ = idx\n        \n        @property\n        def index(self):\n            return self.idx_\n\n        @property\n        def name(self):\n            return self.fcn_.GetParName(self.idx_)\n        \n        @name.setter\n        def name(self, val):\n            return self.fcn_.SetParName(self.idx_, val)\n\n        @property\n        def value(self):\n            return self.fcn_.GetParameter(self.idx_)\n\n        @value.setter\n        def value(self, val):\n            self.fcn_.SetParameter(self.idx_, val)\n\n        @property\n        def error(self):\n            return self.fcn_.GetParError(self.idx_)\n\n        @error.setter\n        def error(self, val):\n            return self.fcn_.SetParError(self.idx_, val)\n\n        @property\n        def limits(self):\n            m = QROOT.Double()\n            M = QROOT.Double()\n            self.fcn_.GetParLimits(self.idx_, m, M)\n            return float(m), float(M)\n\n        @limits.setter\n        def limits(self, val):\n            if not hastattr(val, '__len__') and len(val) != 2:\n                raise RuntimeError('Function limits must be a tuple size 2')\n            self.fcn_.SetParLimits(self.idx_, val[0], val[1])\n\n    def __getitem__(self, value):\n        if isinstance(value, basestring):\n            idx = self.GetParNumber(value)\n        elif isinstance(value, int):\n            idx = value\n        else:\n            raise ValueError('Function index must be a integer or a string')\n        return BaseFunction.ParProxy(self, idx)\n\n\n@snake_case_methods\nclass F1(Plottable, NameOnlyObject, BaseFunction, QROOT.TF1):\n    _ROOT = QROOT.TF1\n\n    def __init__(self, *args, **kwargs):\n        name = kwargs.pop('name', None)\n        super(F1, self).__init__(*args, name=name)\n        self._post_init(**kwargs)\n\n\n@snake_case_methods\nclass F2(Plottable, NameOnlyObject, BaseFunction, QROOT.TF2):\n    _ROOT = QROOT.TF2\n\n    def __init__(self, *args, **kwargs):\n        name = kwargs.pop('name', None)\n        super(F2, self).__init__(*args, name=name)\n        self._post_init(**kwargs)\n\n\n@snake_case_methods\nclass F3(Plottable, NameOnlyObject, BaseFunction, QROOT.TF3):\n    _ROOT = QROOT.TF3\n\n    def __init__(self, *args, **kwargs):\n        name = kwargs.pop('name', None)\n        super(F3, self).__init__(*args, name=name)\n        self._post_init(**kwargs)\n", "path": "rootpy/plotting/func.py"}], "after_files": [{"content": "from __future__ import absolute_import\n\nfrom .. import QROOT\nfrom ..decorators import snake_case_methods\nfrom .base import Plottable\nfrom ..base import NameOnlyObject\nimport six\n\n__all__ = [\n    'F1',\n    'F2',\n    'F3',\n]\n\nclass BaseFunction(object):\n    class ParProxy(object):\n        def __init__(self, fcn, idx):\n            self.fcn_ = fcn\n            self.idx_ = idx\n\n        @property\n        def index(self):\n            return self.idx_\n\n        @property\n        def name(self):\n            return self.fcn_.GetParName(self.idx_)\n\n        @name.setter\n        def name(self, val):\n            return self.fcn_.SetParName(self.idx_, val)\n\n        @property\n        def value(self):\n            return self.fcn_.GetParameter(self.idx_)\n\n        @value.setter\n        def value(self, val):\n            self.fcn_.SetParameter(self.idx_, val)\n\n        @property\n        def error(self):\n            return self.fcn_.GetParError(self.idx_)\n\n        @error.setter\n        def error(self, val):\n            return self.fcn_.SetParError(self.idx_, val)\n\n        @property\n        def limits(self):\n            m = QROOT.Double()\n            M = QROOT.Double()\n            self.fcn_.GetParLimits(self.idx_, m, M)\n            return float(m), float(M)\n\n        @limits.setter\n        def limits(self, val):\n            if not hasattr(val, '__len__') and len(val) != 2:\n                raise RuntimeError('Function limits must be a tuple size 2')\n            self.fcn_.SetParLimits(self.idx_, val[0], val[1])\n\n    def __getitem__(self, value):\n        if isinstance(value, six.string_types):\n            idx = self.GetParNumber(value)\n        elif isinstance(value, six.integer_types):\n            idx = value\n        else:\n            raise ValueError('Function index must be a integer or a string')\n        return BaseFunction.ParProxy(self, idx)\n\n\n@snake_case_methods\nclass F1(Plottable, NameOnlyObject, BaseFunction, QROOT.TF1):\n    _ROOT = QROOT.TF1\n\n    def __init__(self, *args, **kwargs):\n        name = kwargs.pop('name', None)\n        super(F1, self).__init__(*args, name=name)\n        self._post_init(**kwargs)\n\n\n@snake_case_methods\nclass F2(Plottable, NameOnlyObject, BaseFunction, QROOT.TF2):\n    _ROOT = QROOT.TF2\n\n    def __init__(self, *args, **kwargs):\n        name = kwargs.pop('name', None)\n        super(F2, self).__init__(*args, name=name)\n        self._post_init(**kwargs)\n\n\n@snake_case_methods\nclass F3(Plottable, NameOnlyObject, BaseFunction, QROOT.TF3):\n    _ROOT = QROOT.TF3\n\n    def __init__(self, *args, **kwargs):\n        name = kwargs.pop('name', None)\n        super(F3, self).__init__(*args, name=name)\n        self._post_init(**kwargs)\n", "path": "rootpy/plotting/func.py"}]}