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

Issue:
Composite map - axes in arcsec
Hello,

after the upgrade to SunPy 0.8 all my composite maps have a different axes scaling compared to the "usual" arcsec - I see that even the example image from the documentation shows that the X- and Y- axes of the full disk go from -0.3 to +0.3 arcsec. 

![maps-8](https://user-images.githubusercontent.com/14076543/31283961-d1ec599e-aabf-11e7-919b-7900dacb2d4b.png)

How to make the plot show the "true" arcsec values? If I convert the axes values into u*arcsec nothing happens, because according to the plot the axes are still in arcsec.


Discussion:
I add here a link to the code I am using https://gist.github.com/estathe/652a367aafa3a310923b7fc31514100e and to the files https://drive.google.com/open?id=0B54mlsw016xTNUswanhWMUtsRmM .

I am creating a differentially rotated composite map, but I find the same problem even if I don't use the differential rotation function. Basically I would like to plot my map between [-400,0] and [-400,0] arcsec, but after creating the composite map these limits correspond _roughly_ to [-0.11,0] and [-0.11,0], and there is no obvious way to go back to the normal arcsec units. This problem does not appear when plotting a generic map or a differentially rotated one, only when using composite maps.

Thanks!

Resolving patch:
diff --git a/sunpy/map/compositemap.py b/sunpy/map/compositemap.py
--- a/sunpy/map/compositemap.py
+++ b/sunpy/map/compositemap.py
@@ -221,7 +221,9 @@ def set_alpha(self, index, alpha):
             The index of the map in the composite map.
 
         alpha : `float`
-            A float in the range 0 to 1.
+            A float in the range 0 to 1.  Increasing values of alpha decrease
+            the transparency of the layer (0 is complete transparency, 1
+            indicates the layer will be completely opaque).
 
         Returns
         -------
@@ -413,9 +415,13 @@ def plot(self, axes=None, annotate=True,  # pylint: disable=W0613
         # Plot layers of composite map
         for m in self._maps:
             # Parameters for plotting
+            bl = m._get_lon_lat(m.bottom_left_coord)
+            tr = m._get_lon_lat(m.top_right_coord)
+            x_range = list(u.Quantity([bl[0], tr[0]]).to(m.spatial_units[0]).value)
+            y_range = list(u.Quantity([bl[1], tr[1]]).to(m.spatial_units[1]).value)
             params = {
                 "origin": "lower",
-                "extent": list(m.xrange.value) + list(m.yrange.value),
+                "extent": x_range + y_range,
                 "cmap": m.plot_settings['cmap'],
                 "norm": m.plot_settings['norm'],
                 "alpha": m.alpha,


Test patch:
Repository: sunpy/sunpy

Issue:
Gamma in map doesn't do anything
The gamma parameter doesn't do anything in map and should be removed.  It has been superseded by the much better functionality in map.plot_settings.


Discussion:
so I suppose removing all such instances will do.

@wafels are you working on it currently?

Resolving patch:
diff --git a/sunpy/map/compositemap.py b/sunpy/map/compositemap.py
--- a/sunpy/map/compositemap.py
+++ b/sunpy/map/compositemap.py
@@ -56,7 +56,7 @@ class CompositeMap(object):
         Set the plot settings for a map with the CompositeMap.
     set_zorder(index, zorder)
         Set the layering preference (z-order) for a map within the CompositeMap.
-    plot(figure=None, overlays=None, draw_limb=False, gamma=1.0,
+    plot(figure=None, overlays=None, draw_limb=False,
     draw_grid=False, colorbar=True, basic_plot=False,title="SunPy Plot",
     matplot_args)
         Plots the composite map object using matplotlib
@@ -328,7 +328,8 @@ def draw_limb(self, index=None, axes=None, **kwargs):
 
         index_check = hasattr(self._maps[index], 'rsun_obs')
         if not index_check or index is None:
-            raise ValueError("Specified index does not have all the required attributes to draw limb.")
+            raise ValueError("Specified index does not have all"
+                             " the required attributes to draw limb.")
 
         return self._maps[index].draw_limb(axes=axes, **kwargs)
 
@@ -365,7 +366,8 @@ def draw_grid(self, index=None, axes=None, grid_spacing=20*u.deg, **kwargs):
 
         index_check = all([hasattr(self._maps[index], k) for k in needed_attrs])
         if not index_check or index is None:
-            raise ValueError("Specified index does not have all the required attributes to draw grid.")
+            raise ValueError("Specified index does not have all"
+                             " the required attributes to draw grid.")
 
         ax = self._maps[index].draw_grid(axes=axes, grid_spacing=grid_spacing, **kwargs)
         return ax
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -1614,8 +1614,6 @@ def peek(self, draw_limb=False, draw_grid=False,
             Whether solar meridians and parallels are plotted.
             If `~astropy.units.Quantity` then sets degree difference between
             parallels and meridians.
-        gamma : float
-            Gamma value to use for the color map.
         colorbar : bool
             Whether to display a colorbar next to the plot.
         basic_plot : bool
diff --git a/sunpy/map/mapcube.py b/sunpy/map/mapcube.py
--- a/sunpy/map/mapcube.py
+++ b/sunpy/map/mapcube.py
@@ -106,9 +106,6 @@ def plot(self, axes=None, resample=None, annotate=True,
 
         Parameters
         ----------
-        gamma: float
-            Gamma value to use for the color map
-
         axes: mpl axes
             axes to plot the animation on, if none uses current axes
 


Test patch:
Repository: sunpy/sunpy

Issue:
Document the CI
DOCUMENT ALL THE THINGS



Discussion:
Can I work on this?

This is probably better done by @dpshelio as he configured the system. We have a label for issues that are good to start with: https://github.com/sunpy/sunpy/issues?q=is%3Aissue+is%3Aopen+label%3Apackage-novice


Resolving patch:
diff --git a/sunpy/net/jsoc/attrs.py b/sunpy/net/jsoc/attrs.py
--- a/sunpy/net/jsoc/attrs.py
+++ b/sunpy/net/jsoc/attrs.py
@@ -12,8 +12,7 @@ class Series(_VSOSimpleAttr):
     """
     The JSOC Series to Download.
 
-    See `this<http://jsoc.stanford.edu/JsocSeries_DataProducts_map.html>_`
-    for a list of series'.
+    This is the list of `Series <http://jsoc.stanford.edu/JsocSeries_DataProducts_map.html>_`.
     """
     pass
 


Test patch:
Repository: sunpy/sunpy

Issue:
Installation of sunpy via pip with all dependencies fails
python3.6, pip9.03

    pip install sunpy[all]
    ...
    Collecting dateutil; extra == "all" (from sunpy[all])
    Could not find a version that satisfies the requirement dateutil; extra == "all" (from sunpy[all]) (from versions: )
    No matching distribution found for dateutil; extra == "all" (from sunpy[all])

Looks like all other instances of `dateutil` have been updated to `python-dateutil` except in setup.py [here](https://github.com/sunpy/sunpy/blob/master/setup.py#L111)


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -108,7 +108,7 @@
 extras_require = {'database': ["sqlalchemy"],
                   'image': ["scikit-image"],
                   'jpeg2000': ["glymur"],
-                  'net': ["suds-jurko", "beautifulsoup4", "requests", "dateutil"],
+                  'net': ["suds-jurko", "beautifulsoup4", "requests", "python-dateutil"],
                   'tests': ["pytest", "pytest-cov", "pytest-mock", "pytest-rerunfailures", "mock", "hypothesis"]}
 extras_require['all'] = extras_require['database'] + extras_require['image'] + \
                         extras_require['net'] + extras_require['tests']


Test patch:
Repository: sunpy/sunpy

Issue:
Bad spelling in Map
In mapbase, `self._default_heliographic_lattitude` has one too many t's in "lattitude". This does not cause anything to crash (as far as I can tell), but it could make things difficult to find later.


Discussion:

Resolving patch:
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -181,7 +181,7 @@ def __init__(self, data, header, plot_settings=None, **kwargs):
         self._default_time = None
         self._default_dsun = None
         self._default_carrington_longitude = None
-        self._default_heliographic_lattitude = None
+        self._default_heliographic_latitude = None
         self._default_heliographic_longitude = None
 
         # Validate header
@@ -603,13 +603,13 @@ def heliographic_latitude(self):
                                                             self.meta.get('solar_b0', None)))
 
         if heliographic_latitude is None:
-            if self._default_heliographic_lattitude is None:
+            if self._default_heliographic_latitude is None:
                 warnings.warn_explicit("Missing metadata for heliographic latitude:"
                                        " assuming Earth-based observer",
                                        Warning, __file__,
                                        inspect.currentframe().f_back.f_lineno)
-                self._default_heliographic_lattitude = get_sun_B0(self.date)
-            heliographic_latitude = self._default_heliographic_lattitude
+                self._default_heliographic_latitude = get_sun_B0(self.date)
+            heliographic_latitude = self._default_heliographic_latitude
 
         if isinstance(heliographic_latitude, six.string_types):
             heliographic_latitude = float(heliographic_latitude)


Test patch:
Repository: sunpy/sunpy

Issue:
aiaprep can not be used to align AIA and HMI images
`aiaprep` explicitly checks the type of the map to make sure it's `AIAMap` when really it should allow `HMIMap` as well because then you can align AIA images with HMI, and the metadata structure is sufficiently similar that there is no reason why this would not work.

The fix I think would be best would be to allow both `AIAMap` and `HMIMap` in [this](https://github.com/sunpy/sunpy/blob/master/sunpy/instr/aia.py#L45) `isinstance` check. On the other hand you could just drop it altogether and just hope it works :laughing: 


Discussion:

Resolving patch:
diff --git a/sunpy/instr/aia.py b/sunpy/instr/aia.py
--- a/sunpy/instr/aia.py
+++ b/sunpy/instr/aia.py
@@ -5,7 +5,7 @@
 import numpy as np
 import astropy.units as u
 
-from sunpy.map.sources.sdo import AIAMap
+from sunpy.map.sources.sdo import AIAMap, HMIMap
 
 __all__ = ['aiaprep']
 
@@ -42,7 +42,7 @@ def aiaprep(aiamap):
     therefore differ from the original file.
     """
 
-    if not isinstance(aiamap, AIAMap):
+    if not isinstance(aiamap, (AIAMap, HMIMap)):
         raise ValueError("Input must be an AIAMap")
 
     # Target scale is 0.6 arcsec/pixel, but this needs to be adjusted if the map


Test patch:
diff --git a/sunpy/instr/tests/test_aia.py b/sunpy/instr/tests/test_aia.py
--- a/sunpy/instr/tests/test_aia.py
+++ b/sunpy/instr/tests/test_aia.py
@@ -13,9 +13,11 @@
 # functions
 
 
-@pytest.fixture
-def original():
-    return sunpy.map.Map(test.get_test_filepath("aia_171_level1.fits"))
+@pytest.fixture(scope="module",
+                params=[test.get_test_filepath("aia_171_level1.fits"),
+                        test.get_test_filepath("resampled_hmi.fits")])
+def original(request):
+    return sunpy.map.Map(request.param)
 
 
 @pytest.fixture
Repository: sunpy/sunpy

Issue:
Solar Cycle Gallery example out of date
The example includes the following text 

> For this example we will use the SunPy sample data, if you want the current data, delete the argument to the create function. i.e. noaa = lc.NOAAIndicesLightCurve.create()

This text is inline and therefore not checked during build so was not caught. This should be fixed and this behavior should be discouraged.


Discussion:

Resolving patch:
diff --git a/examples/plotting/solar_cycle_example.py b/examples/plotting/solar_cycle_example.py
--- a/examples/plotting/solar_cycle_example.py
+++ b/examples/plotting/solar_cycle_example.py
@@ -14,25 +14,25 @@
 from sunpy.data.sample import NOAAINDICES_TIMESERIES, NOAAPREDICT_TIMESERIES
 
 ###############################################################################
-# For this example we will use the SunPy sample data, if you want the current
-# data, delete the argument to the ``create`` function. i.e.
-# ``noaa = lc.NOAAIndicesLightCurve.create()``
+# For this example we will use the SunPy sample data. This code snippet grabs
+# the most current NOAA solar cycle data as a ``TimeSeries``
+# (see :ref:`timeseries_code_ref`).
 
 noaa = ts.TimeSeries(NOAAINDICES_TIMESERIES, source='noaaindices')
 noaa_predict = ts.TimeSeries(NOAAPREDICT_TIMESERIES, source='noaapredictindices')
 
 ###############################################################################
-# Next lets grab the data again to create a new data structure that we will
-# shift by 12 years to simulate the next solar cycle. We will truncate the
-# data to only plot what is necessary.
+# Next, we grab a new copy of the data and shift it forward 12 years to
+# simulate the next solar cycle. We will also truncate the data to ensure
+# that we only plot what is necessary.
 
 noaa2 = ts.TimeSeries(NOAAINDICES_TIMESERIES, source='noaaindices')
 noaa2.data = noaa2.data.shift(2, freq=datetime.timedelta(days=365*12))
 noaa2 = noaa2.truncate('2021/04/01', '2030/01/01')
 
 ###############################################################################
-# Finally lets plot everything together with some arbitrary range for the
-# strength of the next solar cycle.
+# Finally, we plot both ``noaa`` and ``noaa2`` together, with an arbitrary
+# range for the strength of the next solar cycle.
 
 plt.plot(noaa.data.index, noaa.data['sunspot RI'], label='Sunspot Number')
 plt.plot(noaa_predict.data.index, noaa_predict.data['sunspot'],


Test patch:
Repository: sunpy/sunpy

Issue:
show_colormaps() is not big enough to show the colormap names
See attached picture.  This affects the gallery too - see http://docs.sunpy.org/en/stable/generated/gallery/plotting/sunpy_colormaps_reference.html#sphx-glr-generated-gallery-plotting-sunpy-colormaps-reference-py
![figure_1](https://user-images.githubusercontent.com/983575/44535050-2983b400-a6c7-11e8-8bb1-771a40228c83.png)



Discussion:
Is this issue still open?
Yeah, the top name is still cut off. 

Resolving patch:
diff --git a/sunpy/cm/cm.py b/sunpy/cm/cm.py
--- a/sunpy/cm/cm.py
+++ b/sunpy/cm/cm.py
@@ -192,7 +192,7 @@ def show_colormaps(search=None):
     a = np.linspace(0, 1, 256).reshape(1, -1)  # pylint: disable=E1103
     a = np.vstack((a, a))
 
-    fig = plt.figure(figsize=(5, 10),dpi=64)
+    fig = plt.figure(figsize=(7, 10),dpi=128)
     fig.subplots_adjust(top=0.99, bottom=0.01, left=0.2, right=0.99)
     for i, name in enumerate(maps):
         ax = plt.subplot(nmaps, 1, i + 1)


Test patch:
Repository: sunpy/sunpy

Issue:
aiaprep is throwing a submap warning.
The function aiaprep working on full disk images is throwing a submap warning.

> /home/ireland/anaconda3/lib/python3.6/site-packages/sunpy-0.9.dev9495-py3.6-linux-x86_64.egg/sunpy/map/mapbase.py:1290: Warning: GenericMap.submap now takes pixel values as `bottom_left` and `top_right` not `range_a` and `range_b`
>   " and `top_right` not `range_a` and `range_b`", Warning)
> 

I don't think it should be throwing this warning even although it appears that the code is working as intended.  It may be a case of bad instance checking in submap, or poorly specified co-ordinates in aiaprep.


Discussion:
i want to work on this issue

@sapnamish Go ahead!
It looks like this warning was added to `GenericMap.submap` in sunpy 0.8.0 to make users aware of the change from `range_a`/`range_b` to `bottom_left`/`top_right`. The warning appears to be issued even when input is valid (i.e. two `Quantity` objects with pixel units). Therefore, it isn't possible to provide two pixel `Quantity` objects and *not* see the warning when using the method's documented API.

Can this warning simply be removed from `GenericMap.submap` now that the new API has been in place for awhile?
Alternatively, `aiaprep` could filter/ignore the `Warning` issued by `GenericMap.submap`, but that might silence other warnings in `submap` that actually need attention. Does anyone have thoughts on how to move forward with this issue?
Shouldn't that warning just be removed on master? 

Resolving patch:
diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -1289,11 +1289,7 @@ def submap(self, bottom_left, top_right=None):
             y_pixels[1] = np.floor(y_pixels[1] + 1)
 
         elif (isinstance(bottom_left, u.Quantity) and bottom_left.unit.is_equivalent(u.pix) and
-              isinstance(top_right, u.Quantity) and bottom_left.unit.is_equivalent(u.pix)):
-
-            warnings.warn("GenericMap.submap now takes pixel values as `bottom_left`"
-                          " and `top_right` not `range_a` and `range_b`", Warning)
-
+              isinstance(top_right, u.Quantity) and top_right.unit.is_equivalent(u.pix)):
             x_pixels = u.Quantity([bottom_left[0], top_right[0]]).value
             y_pixels = u.Quantity([top_right[1], bottom_left[1]]).value
 


Test patch:
Repository: sunpy/sunpy

Issue:
Guide for database skipped
Within `docs/guide/acquiring_data/database.rst`, are many database examples. Recently we have to skip the entire file due to one big issue. 

The results of the online file retrieval varies on the source of the test or even the day. Basically if any of the online servers either report different data or are down, the file will fail. This means that all the large text need to be updated and it's very tedious work. 

We need a better way but right now, we don't have one. 




Discussion:

Resolving patch:
diff --git a/sunpy/database/tables.py b/sunpy/database/tables.py
--- a/sunpy/database/tables.py
+++ b/sunpy/database/tables.py
@@ -19,10 +19,24 @@
 import sunpy
 from sunpy import config
 from sunpy.time import parse_time
+from sunpy.io.header import FileHeader
 from sunpy.io import fits, file_tools as sunpy_filetools
 
 TIME_FORMAT = config.get("general", "time_format")
 
+DEFAULT_HEADER = FileHeader([('SIMPLE', True),
+            ('BITPIX', 8),
+            ('NAXIS', 0),
+            ('EXTEND', True),
+            ('COMMENT', ''),
+            ('HISTORY', ''),
+            ('KEYCOMMENTS',
+            {'SIMPLE': 'conforms to FITS standard',
+            'BITPIX': 'array data type',
+            'NAXIS': 'number of array dimensions'}),
+            ('WAVEUNIT', None)])
+
+
 __all__ = [
     'WaveunitNotFoundError', 'WaveunitNotConvertibleError', 'JSONDump',
     'FitsHeaderEntry', 'FitsKeyComment', 'Tag', 'DatabaseEntry',
@@ -645,6 +659,13 @@ def entries_from_file(file, default_waveunit=None,
 
     """
     headers = fits.get_header(file)
+
+    # This just checks for blank default headers
+    # due to compression.
+    for header in headers:
+        if header == DEFAULT_HEADER:
+            headers.remove(header)
+
     if isinstance(file, str):
         filename = file
     else:
@@ -753,7 +774,7 @@ def entries_from_dir(fitsdir, recursive=False, pattern='*',
 
     """
     for dirpath, dirnames, filenames in os.walk(fitsdir):
-        filename_paths = (os.path.join(dirpath, name) for name in filenames)
+        filename_paths = (os.path.join(dirpath, name) for name in sorted(filenames))
         for path in fnmatch.filter(filename_paths, pattern):
             try:
                 filetype = sunpy_filetools._detect_filetype(path)


Test patch:
diff --git a/sunpy/util/tests/test_config.py b/sunpy/util/tests/test_config.py
--- a/sunpy/util/tests/test_config.py
+++ b/sunpy/util/tests/test_config.py
@@ -15,6 +15,8 @@ def test_get_and_create_download_dir():
     config.set('downloads', 'download_dir', new_path)
     path = get_and_create_download_dir()
     assert path == os.path.join(USER, new_path)
+    # Set the config back
+    config.set('downloads', 'download_dir', os.path.join(USER, 'sunpy', 'data'))
 
 
 def test_get_and_create_sample_dir():
@@ -26,3 +28,5 @@ def test_get_and_create_sample_dir():
     config.set('downloads', 'sample_dir', new_path)
     path = get_and_create_sample_dir()
     assert path == new_path
+    # Set the config back
+    config.set('downloads', 'download_dir', os.path.join(USER, 'sunpy', 'data', 'sample_data'))
Repository: sunpy/sunpy

Issue:
ImageAnimatorWCS unit_x_axis and unit_y_axis do not follow image_axes
The units are always applied to the last two dimensions of the WCS, which is just wrong.


Discussion:

Resolving patch:
diff --git a/sunpy/visualization/animator/image.py b/sunpy/visualization/animator/image.py
--- a/sunpy/visualization/animator/image.py
+++ b/sunpy/visualization/animator/image.py
@@ -224,12 +224,14 @@ def _get_main_axes(self):
         return axes
 
     def _set_unit_in_axis(self, axes):
+        x_index = self.slices_wcsaxes.index("x")
+        y_index = self.slices_wcsaxes.index("y")
         if self.unit_x_axis is not None:
-            axes.coords[2].set_format_unit(self.unit_x_axis)
-            axes.coords[2].set_ticks(exclude_overlapping=True)
+            axes.coords[x_index].set_format_unit(self.unit_x_axis)
+            axes.coords[x_index].set_ticks(exclude_overlapping=True)
         if self.unit_y_axis is not None:
-            axes.coords[1].set_format_unit(self.unit_y_axis)
-            axes.coords[1].set_ticks(exclude_overlapping=True)
+            axes.coords[y_index].set_format_unit(self.unit_y_axis)
+            axes.coords[y_index].set_ticks(exclude_overlapping=True)
 
     def plot_start_image(self, ax):
         """Sets up plot of initial image."""


Test patch:
Repository: sunpy/sunpy

Issue:
Pip installing sunpy dev fails
With `ci-helpers` I run into this issue for both travis/linux and appveyor:

Please have a look and open a PR in `ci-helpers` with the suggested fix for the case of `SUNPY_VERSION='dev'`

```
+++++python -m pip install git+https://github.com/sunpy/sunpy.git#egg=sunpy --upgrade --no-deps
Collecting sunpy from git+https://github.com/sunpy/sunpy.git#egg=sunpy
  Cloning https://github.com/sunpy/sunpy.git to /tmp/pip-install-uowizwdl/sunpy
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  Complete output from command /home/travis/miniconda/envs/test/bin/python /home/travis/miniconda/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp6h0521mp:
  Traceback (most recent call last):
    File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-3jro2te9/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 115, in get_requires_for_build_wheel
      return _get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-3jro2te9/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 101, in _get_build_requires
      _run_setup()
    File "/tmp/pip-build-env-3jro2te9/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 85, in _run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 46, in <module>
      import ah_bootstrap  # noqa
  ModuleNotFoundError: No module named 'ah_bootstrap'
```


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,9 @@
 import builtins  # noqa
 import itertools
 
+# Fix for https://github.com/pypa/pip/issues/6163
+sys.path.insert(0, os.path.dirname(__file__))
+
 try:
     from configparser import ConfigParser
 except ImportError:


Test patch: