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

Issue:
Edit gyrofrequency function to better indicate that it's not just for ions
The code and docstring for [`plasmapy.formulary.gyrofrequency`](https://github.com/PlasmaPy/PlasmaPy/blob/deddb91ea82473ca2a10414cd54dd96d437fdfff/plasmapy/formulary/parameters.py#L983) currently uses notation that assumes the particles are ions, i.e. the `i` in `ω_{ci}` and `m_i`.  This is probably because `gyrofrequency` was originally written as `ion_gyrofrequency` before being made more general.  We should modify the code and docstring within `gyrofrequency` to indicate that it is not just for ions.


Discussion:
Would like to work on this!
> Would like to work on this!

Sure, please feel free to!  And thanks!
Sticking to the noting as used in some textbooks (should I provide references for this statement), I would like to suggest to write `\omega_{cs}`. Not sure though if that is compatible with your formatting? 

Edit: now that I have written it down, just writing `\omega_{c}` is probably cleaner

Resolving patch:
diff --git a/plasmapy/formulary/parameters.py b/plasmapy/formulary/parameters.py
--- a/plasmapy/formulary/parameters.py
+++ b/plasmapy/formulary/parameters.py
@@ -1037,7 +1037,7 @@ def gyrofrequency(B: u.T, particle: Particle, signed=False, Z=None) -> u.rad / u
     gyration around magnetic field lines and is given by:
 
     .. math::
-        ω_{ci} = \frac{Z e B}{m_i}
+        ω_{c} = \frac{Z e B}{m}
 
     The particle gyrofrequency is also known as the particle cyclotron
     frequency or the particle Larmor frequency.
@@ -1074,14 +1074,14 @@ def gyrofrequency(B: u.T, particle: Particle, signed=False, Z=None) -> u.rad / u
     279924... Hz
 
     """
-    m_i = particles.particle_mass(particle)
+    m = particles.particle_mass(particle)
     Z = _grab_charge(particle, Z)
     if not signed:
         Z = abs(Z)
 
-    omega_ci = u.rad * (Z * e * np.abs(B) / m_i).to(1 / u.s)
+    omega_c = u.rad * (Z * e * np.abs(B) / m).to(1 / u.s)
 
-    return omega_ci
+    return omega_c
 
 
 oc_ = gyrofrequency


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Resolve documentation warning for `Exponential.FitParamTuple`
In recent doc builds, we've been getting this warning which needs to be resolved:
```
Warning, treated as error:
/home/runner/work/PlasmaPy/PlasmaPy/docs/api/plasmapy.analysis.fit_functions.Exponential.rst.rst:18:autosummary: failed to import Exponential.FitParamTuple
ERROR: InvocationError for command /home/runner/work/PlasmaPy/PlasmaPy/.tox/build_docs/bin/sphinx-build docs docs/_build/html -W -b html (exited with code 2)
```



Discussion:
I am aware of this and currently looking into it.  It's a little bizarre because this import should not even be happening.  Plus I don't get the warning on my local builds.  My suspension is it's due to how the `.readthedocs.yml` is configured and our GitHub action.
So, the documentation tests started failing about 7 days ago when Sphinx release `v4.1.0`.  I confirmed this when comparing the [last passed test](https://github.com/PlasmaPy/PlasmaPy/runs/3032207723?check_suite_focus=true) to the [first failed test](https://github.com/PlasmaPy/PlasmaPy/runs/3041743126?check_suite_focus=true).  Last passed used `sphinx==4.0.3` and all the failed tests since used `sphinx>=4.1.0`.

Resolving patch:
diff --git a/plasmapy/analysis/fit_functions.py b/plasmapy/analysis/fit_functions.py
--- a/plasmapy/analysis/fit_functions.py
+++ b/plasmapy/analysis/fit_functions.py
@@ -51,12 +51,7 @@ def __init__(
 
         """
 
-        self.FitParamTuple = namedtuple("FitParamTuple", self._param_names)
-        """
-        A `~collections.namedtuple` used for attributes :attr:`params` and
-        :attr:`param_errors`.  The attribute :attr:`parameter_names` defines
-        the tuple field names.
-        """
+        self._FitParamTuple = namedtuple("FitParamTuple", self._param_names)
 
         if params is None:
             self._params = None
@@ -221,6 +216,15 @@ def curve_fit_results(self):
         """
         return self._curve_fit_results
 
+    @property
+    def FitParamTuple(self):
+        """
+        A `~collections.namedtuple` used for attributes :attr:`params` and
+        :attr:`param_errors`.  The attribute :attr:`parameter_names` defines
+        the tuple field names.
+        """
+        return self._FitParamTuple
+
     @property
     def params(self) -> Union[None, tuple]:
         """The fitted parameters for the fit function."""


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Remove usage of `distutils` which has been deprecated
It turns out that `distutils` has been deprecated and will be removed in Python 3.12.  We should stop using it prior to our 0.7 release.  Fortunately I only found one usage in: `plasmapy/plasma/sources/openpmd_hdf5.py`.


Discussion:
According to https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html#prefer-setuptools this should be a simple swap from `distutils.version` to `packaging.version`. Might need to add https://github.com/pypa/packaging as a dependency.

Resolving patch:
diff --git a/plasmapy/plasma/sources/openpmd_hdf5.py b/plasmapy/plasma/sources/openpmd_hdf5.py
--- a/plasmapy/plasma/sources/openpmd_hdf5.py
+++ b/plasmapy/plasma/sources/openpmd_hdf5.py
@@ -4,7 +4,7 @@
 import numpy as np
 import os
 
-from distutils.version import StrictVersion
+from packaging.version import Version
 
 from plasmapy.plasma.exceptions import DataStandardError
 from plasmapy.plasma.plasma_base import GenericPlasma
@@ -30,9 +30,9 @@ def _fetch_units(openPMD_dims):
 def _valid_version(openPMD_version, outdated=_OUTDATED_VERSION, newer=_NEWER_VERSION):
     """Checks if the passed version is supported or not."""
 
-    parsed_version = StrictVersion(openPMD_version)
-    outdated_version = StrictVersion(outdated)
-    newer_version = StrictVersion(newer)
+    parsed_version = Version(openPMD_version)
+    outdated_version = Version(outdated)
+    newer_version = Version(newer)
     return outdated_version <= parsed_version < newer_version
 
 


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
collisions.py needs another review
The functionality in `plasmapy/formulary/collisions.py` went through an extensive review in PR #962.  However,  there are some inconsistencies between what is written in the docstrings and what is actually implemented in the associated function.  For example, the docstring for the `coupling_parameter` currently states

```restructuredtext
method : `str`, optional
        The method by which to compute the Coulomb logarithm.
        The default method is the classical straight-line Landau-Spitzer
        method (``"classical"`` or ``"ls"``). The other 6 supported methods
        are ``"ls_min_interp"``, ``"ls_full_interp"``, ``"ls_clamp_mininterp"``,
        ``"hls_min_interp"``, ``"hls_max_interp"``, and ``"hls_full_interp"``.
        Please refer to the docstring of `Coulomb_logarithm` for more
        information about these methods.
```

for the `method` keyword but the function only accepts values of `'classical'` and `'quantum'`.  Since so much was touched by PR #962, we need to read through each function and make sure the docstrings and contained functionality are consistent.


Discussion:
@namurphy and @Tiger-Du would you two be willing to take this up?
Sorry for the delay.

This is a good catch. I looked through `collisions.py` just now and did not come across any other inconsistencies like this one. Other files were changed in PR #962, so I will take a look at those files as well and will open a PR to fix this and any other inconsistencies tomorrow.

Resolving patch:
diff --git a/plasmapy/formulary/collisions.py b/plasmapy/formulary/collisions.py
--- a/plasmapy/formulary/collisions.py
+++ b/plasmapy/formulary/collisions.py
@@ -1922,15 +1922,10 @@ def coupling_parameter(
         :math:`μ` is the reduced mass.
 
     method : `str`, optional
-        The method by which to compute the Coulomb logarithm.  The
-        default method is the classical straight-line Landau-Spitzer
-        method (``"classical"`` or ``"ls"``). The other 6 supported
-        methods are ``"ls_min_interp"``, ``"ls_full_interp"``,
-        ``"ls_clamp_mininterp"``, ``"hls_min_interp"``,
-        ``"hls_max_interp"``, and ``"hls_full_interp"``.  Please refer
-        to the docstring of
-        `~plasmapy.formulary.collisions.Coulomb_logarithm` for more
-        information about these methods.
+        The method by which to compute the coupling parameter: either
+        ``"classical"`` or ``"quantum"``. The default method is ``"classical"``.
+        The Notes section of this docstring has more information about
+        these two methods.
 
     Returns
     -------


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Typo maybe?
Hello, I was reading you conf.py to steal some bits ;) and I came across this:

https://github.com/PlasmaPy/PlasmaPy/blob/2b798b0902c9e38d23102b79a955bfc961e56c9c/docs/conf.py#L151-L152

Looks like a typo and/or a leftover.
Typo maybe?
Hello, I was reading you conf.py to steal some bits ;) and I came across this:

https://github.com/PlasmaPy/PlasmaPy/blob/2b798b0902c9e38d23102b79a955bfc961e56c9c/docs/conf.py#L151-L152

Looks like a typo and/or a leftover.


Discussion:
Looks like you're correct. Thanks for pointing it out. Would you be willing to open a pull request to resolve this?
Looks like you're correct. Thanks for pointing it out. Would you be willing to open a pull request to resolve this?

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -149,16 +149,13 @@
 #        However, release needs to be a semantic style version number, so set
 #        the 'unknown' case to ''.
 release = "" if release == "unknown" else release
-if release == "unknown":
-    release = version = revision = ""
+pv = parse_version(release)
+release = pv.public
+version = ".".join(release.split(".")[:2])  # short X.Y version
+if pv.local is not None:
+    revision = pv.local[1:]  # revision number w/o the leading g
 else:
-    pv = parse_version(release)
-    release = pv.public
-    version = ".".join(release.split(".")[:2])  # short X.Y version
-    if pv.local is not None:
-        revision = pv.local[1:]  # revision number w/o the leading g
-    else:
-        revision = ""
+    revision = ""
 
 # This is added to the end of RST files — a good place to put substitutions to
 # be used globally.


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Missing factor of Z in fundamental collision frequency
Hi, I think the function `formulary.collisions.fundamental_electron_collision_freq` is calling `collision_frequency` incorrectly by using the electron density `n_e` rather than `n_i`. In the input description for `collision_frequency` it specifies that for electron-ion collisions `n` should be the ion density, and in `fundamental_electron_collision_freq` it explicitly sets the species as `[ion, "e-"]`.

I noticed this problem while checking the Spitzer thermal conductivity and spotting that the Z dependence comes out wrong. The original Spitzer-Harm paper PR 89, 5 (1953) gives the Z dependence in the conductivity K as delta_T * epsilon / Z. In the current implementation, however, the Z dependence in K comes from kappa_hat (giving delta_T * epsilon) and 1/collision_frequency, where it's proportional to n*b_perp^2, which is proportional to n_e*Z^2. That gives a Z dependence of delta_T * epsilon/Z^2, which will go very wrong for high Z. If instead we call `collision_frequency` using n_i=n_e/Z, it should give n_i*Z^2=n_e*Z, giving a final Z dependence of delta_T * epsilon/Z, as required.

https://github.com/PlasmaPy/PlasmaPy/blob/2a138014b5789a816dc89c87859b5107b62ab176/plasmapy/formulary/collisions.py#L1195


Discussion:

Resolving patch:
diff --git a/plasmapy/formulary/collisions.py b/plasmapy/formulary/collisions.py
--- a/plasmapy/formulary/collisions.py
+++ b/plasmapy/formulary/collisions.py
@@ -1191,8 +1191,9 @@ def fundamental_electron_collision_freq(
 
     species = [ion, "e-"]
     Z_i = particles.charge_number(ion) * u.dimensionless_unscaled
+    n_i = n_e / Z_i
     nu = collision_frequency(
-        T_e, n_e, species, z_mean=Z_i, V=V, method=coulomb_log_method
+        T_e, n_i, species, z_mean=Z_i, V=V, method=coulomb_log_method
     )
     coeff = 4 / np.sqrt(np.pi) / 3
 


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Make doc build compatible with Sphinx ≥ 5.0.0
Sphinx 5.0.0 just came out over the weekend, and we're now getting some doc build errors (initially in #1563).  We set the requirement for `sphinx >= 4.4, < 5.0` in #1579, but will need to make some updates to make our doc build work with Sphinx 5.0.0.  


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -193,7 +193,7 @@
 #
 # This is also used if you do content translation via gettext catalogs.
 # Usually you set "language" from the command line for these cases.
-language = None
+language = "en"
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
@@ -296,7 +296,7 @@
 
 extlinks = {
     "orcid": ("https://orcid.org/%s", "%s"),
-    "wikipedia": ("https://en.wikipedia.org/wiki/", "%s"),
+    "wikipedia": ("https://en.wikipedia.org/wiki/%s", "%s"),
 }
 
 # Specify patterns to ignore when doing a nitpicky documentation build.
diff --git a/docs/plasmapy_sphinx/automodsumm/generate.py b/docs/plasmapy_sphinx/automodsumm/generate.py
--- a/docs/plasmapy_sphinx/automodsumm/generate.py
+++ b/docs/plasmapy_sphinx/automodsumm/generate.py
@@ -66,21 +66,16 @@ class AutomodsummRenderer(AutosummaryRenderer):
 
     app : `sphinx.application.Sphinx`
         Instance of the `sphinx` application.
-
-    template_dir : str
-        Path to a specified template directory.
     """
 
-    def __init__(
-        self,
-        app: Union["Builder", "Sphinx"],
-        template_dir: str = None,
-    ) -> None:
+    def __init__(self, app: "Sphinx") -> None:
 
+        # add plasmapy_sphinx templates directory to the overall templates path
         asumm_path = templates_dir
         relpath = os.path.relpath(asumm_path, start=app.srcdir)
         app.config.templates_path.append(relpath)
-        super().__init__(app, template_dir)
+
+        super().__init__(app)
 
     def render(self, template_name: str, context: Dict) -> str:
         """


Test patch:
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
--- a/.github/workflows/testing.yml
+++ b/.github/workflows/testing.yml
@@ -118,7 +118,7 @@ jobs:
     - name: Install language-pack-fr and tzdata
       run: sudo apt-get install graphviz pandoc
     - name: Run tests
-      run: tox  -e build_docs -- -q
+      run: tox -e build_docs -- -q
   codespell:
     name: codespell
     runs-on: ubuntu-latest
Repository: PlasmaPy/PlasmaPy

Issue:
Add `pyupgrade` to pre-commit configuration
I happened to look at xarray's pre-commit config file and noticed that they were using [pyupgrade](https://github.com/asottile/pyupgrade), which is "a tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language."  For example, if we switched our minimum version from Python 3.7 to 3.8, then this would automatically update the code to use the newer features.  This looks like it could save us a lot of time and effort when we bump our minimum versions.


Discussion:
I ran this with the `--py38-plus` in #1485, and it included a lot of [typing rewrites](https://github.com/asottile/pyupgrade#pep-604-typing-rewrites) (like `Optional[str]` to `str | None`).  These were associated with a `from __future__ import annotations` line that delays evaluation of annotations.  However, because we actually use annotations for our validators and `particle_input`, we would likely run into problems if we adopted that new typing syntax which was adopted in Python 3.10.  If we do add `pyupgrade`, then we'd want to use the `--keep-runtime-typing` option to prevent these changes from being made.

Resolving patch:
diff --git a/plasmapy/__init__.py b/plasmapy/__init__.py
--- a/plasmapy/__init__.py
+++ b/plasmapy/__init__.py
@@ -111,7 +111,7 @@ def online_help(query: str):
 
     url = (
         "http://docs.plasmapy.org/en/stable/search.html?"
-        "{0}&check_keywords=yes&area=default"
+        "{}&check_keywords=yes&area=default"
     ).format(urlencode({"q": query}))
 
     if query.lower() in ("unit", "units", "quantity", "quantities"):
diff --git a/plasmapy/diagnostics/thomson.py b/plasmapy/diagnostics/thomson.py
--- a/plasmapy/diagnostics/thomson.py
+++ b/plasmapy/diagnostics/thomson.py
@@ -471,7 +471,7 @@ def spectral_density(
         raise ValueError("At least one ion species needs to be defined.")
 
     try:
-        if sum([ion.charge_number <= 0 for ion in ions]):
+        if sum(ion.charge_number <= 0 for ion in ions):
             raise ValueError("All ions must be positively charged.")
     # Catch error if charge information is missing
     except ChargeError:
@@ -682,7 +682,7 @@ def _spectral_density_model(wavelengths, settings=None, **params):
 
 
 def spectral_density_model(wavelengths, settings, params):
-    """
+    r"""
     Returns a `lmfit.model.Model` function for Thomson spectral density function.
 
     Parameters


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
`plasma-calculator` does not launch on a Windows 10 system
Original comment...https://github.com/PlasmaPy/PlasmaPy/pull/1610#discussion_r912220976

The `plasma-calculator` does not launch when using a Windows 10 system...

> Also, I get an error when trying to run the calculator on my windows machine...
> 
> ![image](https://user-images.githubusercontent.com/29869348/176960605-65eb86ed-4d28-4236-938f-f545927b70f8.png)
>
> My suspicion is whatever functionality is generating the file path is ignorant of a windows file separator, since the path and file name are mashed into one without a separator.


Discussion:
Here are the [lines](https://github.com/PlasmaPy/PlasmaPy/blob/ddc38b0f6cd0f019de7048a38bd8320231752bf0/plasmapy/utils/calculator/__init__.py#L37) that are getting the module path:
```Python
    module_path = os.path.dirname(os.path.abspath(__file__))
    computed_calculator_path = os.path.join(module_path, "plasma_calculator.ipynb")
```
I can't find any issues with it, but I'm wondering if it needs to be made into a raw string or something.  My mini-computer with Civilization IV as an operating system also has a dual boot with Windows 11...but the fan broke so I won't be able to test it locally.
Not sure.  It'd likely just modify the code to use `pathlib` functionality instead, since `pathlib` is smart to the OS.
One would have hoped that `os` was smart to the OS too, but alas!  I'll attempt to use `pathlib` for this now, though let me know if you've already started to work on it.

Resolving patch:
diff --git a/plasmapy/utils/calculator/__init__.py b/plasmapy/utils/calculator/__init__.py
--- a/plasmapy/utils/calculator/__init__.py
+++ b/plasmapy/utils/calculator/__init__.py
@@ -4,7 +4,7 @@
 __all__ = ["main"]
 
 import argparse
-import os
+import pathlib
 import shlex
 import subprocess
 
@@ -33,17 +33,25 @@ def main():
         "--no-browser", action="store_true", help="Do not open the browser"
     )
 
-    # module_path = plasmapy.__path__[0]
-    module_path = os.path.dirname(os.path.abspath(__file__))
-    computed_calculator_path = os.path.join(module_path, "plasma_calculator.ipynb")
+    module_path = pathlib.Path(__file__).parent.absolute()
+    notebook_path = module_path / "plasma_calculator.ipynb"
+    favicon_path = module_path / "favicon.ico"
 
     args = parser.parse_args()
     theme = "dark" if args.dark else "light"
     no_browser = "--no-browser" if args.no_browser else ""
 
-    command = f"voila {no_browser} --port={args.port} --theme={theme} {computed_calculator_path} \
-        --VoilaConfiguration.file_whitelist favicon.ico"
+    command = [
+        "voila",
+        notebook_path,
+        f"--port={args.port}",
+        f"--theme={theme}",
+        f"--VoilaConfiguration.file_whitelist={favicon_path}",
+    ]
+    if no_browser:
+        command.append(no_browser)
+
     try:
-        subprocess.call(shlex.split(command))
+        subprocess.call(command)
     except KeyboardInterrupt:
         print("Stopping calculator! Bye")


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Rename `docs/whatsnew` to `docs/changelog` and set up appropriate redirects
Following up on a discussion with @rocco8773 today, it'd be helpful to rename `docs/whatsnew` to `docs/changelog` since we've collectively ended up calling it that, and we don't really use the phrase "what's new" very often.  

To do that without causing too many headaches, we can set up some redirects with [sphinx-reredirects](https://documatt.gitlab.io/sphinx-reredirects/usage.html#usage) which we recently added as a Sphinx extension.  This would involve changing `redirects` in `docs/conf.py`.


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -247,15 +247,29 @@
 ]
 
 redirects = {
+    "contributing/install_dev": "../contributing/getting_ready.html",
     "development": "../contributing/",
-    "development/index": "../contributing/index.html",
     "development/changelog_guide": "../contributing/changelog_guide.html",
     "development/code_guide": "../contributing/code_guide.html",
     "development/doc_guide": "../contributing/doc_guide.html",
+    "development/index": "../contributing/index.html",
     "development/install_dev": "../contributing/getting_ready.html",
-    "contributing/install_dev": "../contributing/getting_ready.html",
     "development/release_guide": "../contributing/release_guide.html",
     "development/testing_guide": "../contributing/testing_guide.html",
+    "whatsnew": "../changelog/",
+    "whatsnew/0.1.0": "../changelog/0.1.0.html",
+    "whatsnew/0.1.1": "../changelog/0.1.0.html",
+    "whatsnew/0.2.0": "../changelog/0.1.0.html",
+    "whatsnew/0.3.1": "../changelog/0.1.0.html",
+    "whatsnew/0.4.0": "../changelog/0.1.0.html",
+    "whatsnew/0.5.0": "../changelog/0.1.0.html",
+    "whatsnew/0.6.0": "../changelog/0.1.0.html",
+    "whatsnew/0.7.0": "../changelog/0.1.0.html",
+    "whatsnew/0.8.1": "../changelog/0.1.0.html",
+    "whatsnew/0.9.0": "../changelog/0.1.0.html",
+    "whatsnew/0.9.1": "../changelog/0.1.0.html",
+    "whatsnew/2023.1.0": "../changelog/2023.1.0.html",
+    "whatsnew/index": "../changelog/index.html",
 }
 
 # Use a code highlighting style that meets the WCAG AA contrast standard


Test patch:
Repository: PlasmaPy/PlasmaPy

Issue:
Use `importlib.metadata` to get package version instead of `pkg_resources`
Now that we're using Python 3.8+, we should switch to using `importlib.metadata` to get our version at runtime in `plasmapy/__init__.py`.  We're using `pkg_resources` right now, but that has a "[significant runtime cost](https://github.com/pypa/setuptools_scm/#retrieving-package-version-at-runtime)".


Discussion:
I can work on this! 😄 

Resolving patch:
diff --git a/plasmapy/__init__.py b/plasmapy/__init__.py
--- a/plasmapy/__init__.py
+++ b/plasmapy/__init__.py
@@ -28,7 +28,7 @@
 # Packages may add whatever they like to this file, but
 # should keep this content at the top.
 # ----------------------------------------------------------------------------
-import pkg_resources
+from importlib.metadata import PackageNotFoundError, version
 
 from plasmapy import (
     analysis,
@@ -53,8 +53,8 @@
     #       frozen to the version at time of install.
     #
     #: PlasmaPy version string
-    __version__ = pkg_resources.get_distribution("plasmapy").version
-except pkg_resources.DistributionNotFound:
+    __version__ = version("plasmapy")
+except PackageNotFoundError:
     # package is not installed
     fallback_version = "unknown"
     try:
@@ -120,4 +120,4 @@ def online_help(query: str):
     webbrowser.open(url)
 
 
-del pkg_resources, sys
+del sys


Test patch: