ronantakizawa/codereview-bench huggingface dataset:
Repository: matplotlib/matplotlib
File: lib/matplotlib/tests/test_cm_stubs.py (Python)

Code before:
import matplotlib.pyplot as plt
import re
from pathlib import Path
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    with cm_pyi_path.open("r", encoding="utf-8") as f:
        pyi_content = f.read()

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps found at runtime — is matplotlib installed correctly?"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi — is the file populated?"
    )

    missing_in_stub = runtime_cmaps - stubbed_cmaps

    assert not missing_in_stub, (
            f"Colormaps missing in cm.pyi: {sorted(missing_in_stub)}"
    )


Review comment (bug):
```suggestion
        "No colormaps variables found at runtime in matplotlib.colors"
```
Mentioning the module is helpful. The question is too presumptive and not helpful as we have really no good guess why it can happen. I’d expect in matplotlib was not installed correctly, likely the matplotlib.colors import would already fail.

Code after:
import re
from pathlib import Path

import matplotlib.pyplot as plt
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    pyi_content = cm_pyi_path.read_text(encoding='utf-8')

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

    assert runtime_cmaps == stubbed_cmaps
Repository: matplotlib/matplotlib
File: lib/matplotlib/tests/test_cm_stubs.py (Python)

Code before:
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    with cm_pyi_path.open("r", encoding="utf-8") as f:
        pyi_content = f.read()

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps found at runtime — is matplotlib installed correctly?"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi — is the file populated?"
    )

    missing_in_stub = runtime_cmaps - stubbed_cmaps

    assert not missing_in_stub, (
            f"Colormaps missing in cm.pyi: {sorted(missing_in_stub)}"
    )


Review comment (suggestion):
```suggestion
        "No colormaps found in cm.pyi"
```
I‘d leave out the question here as well. It‘s natural to look into the file if we claim something is not found in there.

Code after:
import matplotlib.pyplot as plt
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    pyi_content = cm_pyi_path.read_text(encoding='utf-8')

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

    assert runtime_cmaps == stubbed_cmaps
Repository: matplotlib/matplotlib
File: lib/matplotlib/cm.pyi (Python)

Code before:
pink: colors.Colormap
prism: colors.Colormap
rainbow: colors.Colormap
seismic: colors.Colormap
spring: colors.Colormap
summer: colors.Colormap
terrain: colors.Colormap
winter: colors.Colormap
Accent: colors.Colormap
Dark2: colors.Colormap
Paired: colors.Colormap
Pastel1: colors.Colormap
Pastel2: colors.Colormap
Set1: colors.Colormap
Set2: colors.Colormap
Set3: colors.Colormap
tab10: colors.Colormap
tab20: colors.Colormap
tab20b: colors.Colormap
tab20c: colors.Colormap
grey: colors.Colormap
gist_grey: colors.Colormap
gist_yerg: colors.Colormap
Grays: colors.Colormap
magma_r: colors.Colormap
inferno_r: colors.Colormap
plasma_r: colors.Colormap
viridis_r: colors.Colormap
cividis_r: colors.Colormap
twilight_r: colors.Colormap
twilight_shifted_r: colors.Colormap
turbo_r: colors.Colormap
berlin_r: colors.Colormap
managua_r: colors.Colormap
vanimo_r: colors.Colormap
Blues_r: colors.Colormap
BrBG_r: colors.Colormap
BuGn_r: colors.Colormap
BuPu_r: colors.Colormap
CMRmap_r: colors.Colormap
GnBu_r: colors.Colormap
Greens_r: colors.Colormap
Greys_r: colors.Colormap
OrRd_r: colors.Colormap
Oranges_r: colors.Colormap
PRGn_r: colors.Colormap
PiYG_r: colors.Colormap
PuBu_r: colors.Colormap
PuBuGn_r: colors.Colormap
PuOr_r: colors.Colormap
PuRd_r: colors.Colormap

Review comment (suggestion):
Just to differentiate here:
```suggestion
Grays: colors.Colormap
# Reversed colormaps
magma_r: colors.Colormap
```

Code after:
pink: colors.Colormap
prism: colors.Colormap
rainbow: colors.Colormap
seismic: colors.Colormap
spring: colors.Colormap
summer: colors.Colormap
terrain: colors.Colormap
winter: colors.Colormap
Accent: colors.Colormap
Dark2: colors.Colormap
Paired: colors.Colormap
Pastel1: colors.Colormap
Pastel2: colors.Colormap
Set1: colors.Colormap
Set2: colors.Colormap
Set3: colors.Colormap
tab10: colors.Colormap
tab20: colors.Colormap
tab20b: colors.Colormap
tab20c: colors.Colormap
grey: colors.Colormap
gist_grey: colors.Colormap
gist_yerg: colors.Colormap
Grays: colors.Colormap
# Reversed colormaps
magma_r: colors.Colormap
inferno_r: colors.Colormap
plasma_r: colors.Colormap
viridis_r: colors.Colormap
cividis_r: colors.Colormap
twilight_r: colors.Colormap
twilight_shifted_r: colors.Colormap
turbo_r: colors.Colormap
berlin_r: colors.Colormap
managua_r: colors.Colormap
vanimo_r: colors.Colormap
Blues_r: colors.Colormap
BrBG_r: colors.Colormap
BuGn_r: colors.Colormap
BuPu_r: colors.Colormap
CMRmap_r: colors.Colormap
GnBu_r: colors.Colormap
Greens_r: colors.Colormap
Greys_r: colors.Colormap
OrRd_r: colors.Colormap
Oranges_r: colors.Colormap
PRGn_r: colors.Colormap
PiYG_r: colors.Colormap
PuBu_r: colors.Colormap
PuBuGn_r: colors.Colormap
PuOr_r: colors.Colormap
Repository: matplotlib/matplotlib
File: lib/matplotlib/tests/test_cm_stubs.py (Python)

Code before:
import matplotlib.pyplot as plt
import re
from pathlib import Path
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    with cm_pyi_path.open("r", encoding="utf-8") as f:
        pyi_content = f.read()

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

Review comment (suggestion):
```suggestion
import re
from pathlib import Path

import matplotlib.pyplot as plt
from matplotlib.colors import Colormap
```

Code after:
import re
from pathlib import Path

import matplotlib.pyplot as plt
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    pyi_content = cm_pyi_path.read_text(encoding='utf-8')

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )
Repository: matplotlib/matplotlib
File: lib/matplotlib/tests/test_cm_stubs.py (Python)

Code before:
import matplotlib.pyplot as plt
import re
from pathlib import Path
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    with cm_pyi_path.open("r", encoding="utf-8") as f:
        pyi_content = f.read()

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

    missing_in_stub = runtime_cmaps - stubbed_cmaps
    extra_in_stub = stubbed_cmaps - runtime_cmaps


    assert not missing_in_stub, (
        f"Colormaps missing in cm.pyi: {sorted(missing_in_stub)}"
    )
    assert not extra_in_stub, (
        f"Extra colormaps in cm.pyi: {sorted(extra_in_stub)}"
    )


Review comment (suggestion):
```suggestion
    pyi_content = cm_pyi_path.read_text(encoding='utf-8')
```

Code after:
import re
from pathlib import Path

import matplotlib.pyplot as plt
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    pyi_content = cm_pyi_path.read_text(encoding='utf-8')

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

    assert runtime_cmaps == stubbed_cmaps
Repository: matplotlib/matplotlib
File: lib/matplotlib/tests/test_cm_stubs.py (Python)

Code before:
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    with cm_pyi_path.open("r", encoding="utf-8") as f:
        pyi_content = f.read()

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

    missing_in_stub = runtime_cmaps - stubbed_cmaps
    extra_in_stub = stubbed_cmaps - runtime_cmaps


    assert not missing_in_stub, (
        f"Colormaps missing in cm.pyi: {sorted(missing_in_stub)}"
    )
    assert not extra_in_stub, (
        f"Extra colormaps in cm.pyi: {sorted(extra_in_stub)}"
    )


Review comment (suggestion):
You can just do:
```suggestion
    assert runtime_cmaps == stubbed_cmaps
```
Pytest will print out the differing items for you.

Code after:
import re
from pathlib import Path

import matplotlib.pyplot as plt
from matplotlib.colors import Colormap


def test_cm_stub_matches_runtime_colormaps():
    runtime_cm = plt.cm
    runtime_cmaps = {
        name
        for name, value in vars(runtime_cm).items()
        if isinstance(value, Colormap)
    }

    cm_pyi_path = Path(__file__).parent.parent / "cm.pyi"
    assert cm_pyi_path.exists(), f"{cm_pyi_path} does not exist"

    pyi_content = cm_pyi_path.read_text(encoding='utf-8')

    stubbed_cmaps = set(
        re.findall(r"^(\w+):\s+colors\.Colormap", pyi_content, re.MULTILINE)
    )

    assert runtime_cmaps, (
        "No colormaps variables found at runtime in matplotlib.colors"
    )
    assert stubbed_cmaps, (
        "No colormaps found in cm.pyi"
    )

    assert runtime_cmaps == stubbed_cmaps
Repository: matplotlib/matplotlib
File: lib/matplotlib/pyplot.py (Python)

Code before:
# Note: The first part of this file is hand-written and must be edited
# in-place. The second part, starting with
#   ### REMAINING CONTENT GENERATED BY boilerplate.py ###
# is generated by the script boilerplate.py. It must not be edited here
# because all changes would be overwritten by the next run of the script.
# For more information see the description at the top of boilerplate.py.

"""
`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
an implicit,  MATLAB-like, way of plotting.  It also opens figures on your
screen, and acts as the figure GUI manager.

pyplot is mainly intended for interactive plots and simple cases of
programmatic plot generation::

    import numpy as np
    import matplotlib.pyplot as plt

    x = np.arange(0, 5, 0.1)
    y = np.sin(x)
    plt.plot(x, y)
    plt.show()

The explicit object-oriented API is recommended for complex plots, though
pyplot is still usually used to create the figure and often the Axes in the
figure. See `.pyplot.figure`, `.pyplot.subplots`, and
`.pyplot.subplot_mosaic` to create figures, and
:doc:`Axes API </api/axes_api>` for the plotting methods on an Axes::

    import numpy as np
    import matplotlib.pyplot as plt

Review comment (suggestion):
```suggestion
# For more information, see the description in boilerplate.py.
```


Code after:
# Note: The first part of this file is hand-written and must be edited
# in-place. The second part, starting with
#   ### REMAINING CONTENT GENERATED BY boilerplate.py ###
# is generated by the script boilerplate.py. It must not be edited here
# because all changes will be overwritten by the next run of the script.
# For more information see the description in boilerplate.py.

"""
`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
an implicit,  MATLAB-like, way of plotting.  It also opens figures on your
screen, and acts as the figure GUI manager.

pyplot is mainly intended for interactive plots and simple cases of
programmatic plot generation::

    import numpy as np
    import matplotlib.pyplot as plt

    x = np.arange(0, 5, 0.1)
    y = np.sin(x)
    plt.plot(x, y)
    plt.show()

The explicit object-oriented API is recommended for complex plots, though
pyplot is still usually used to create the figure and often the Axes in the
figure. See `.pyplot.figure`, `.pyplot.subplots`, and
`.pyplot.subplot_mosaic` to create figures, and
:doc:`Axes API </api/axes_api>` for the plotting methods on an Axes::

    import numpy as np
    import matplotlib.pyplot as plt
Repository: matplotlib/matplotlib
File: lib/matplotlib/pyplot.py (Python)

Code before:
# Note: The first part of this file is hand-written and must be edited
# in-place. The second part, starting with
#   ### REMAINING CONTENT GENERATED BY boilerplate.py ###
# is generated by the script boilerplate.py. It must not be edited here
# because all changes would be overwritten by the next run of the script.
# For more information see the description at the top of boilerplate.py.

"""
`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
an implicit,  MATLAB-like, way of plotting.  It also opens figures on your
screen, and acts as the figure GUI manager.

pyplot is mainly intended for interactive plots and simple cases of
programmatic plot generation::

    import numpy as np
    import matplotlib.pyplot as plt

    x = np.arange(0, 5, 0.1)
    y = np.sin(x)
    plt.plot(x, y)
    plt.show()

The explicit object-oriented API is recommended for complex plots, though
pyplot is still usually used to create the figure and often the Axes in the
figure. See `.pyplot.figure`, `.pyplot.subplots`, and
`.pyplot.subplot_mosaic` to create figures, and
:doc:`Axes API </api/axes_api>` for the plotting methods on an Axes::

    import numpy as np

Review comment (suggestion):
```suggestion
# because all changes will be overwritten by the next run of the script.
```


Code after:
# Note: The first part of this file is hand-written and must be edited
# in-place. The second part, starting with
#   ### REMAINING CONTENT GENERATED BY boilerplate.py ###
# is generated by the script boilerplate.py. It must not be edited here
# because all changes will be overwritten by the next run of the script.
# For more information see the description in boilerplate.py.

"""
`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
an implicit,  MATLAB-like, way of plotting.  It also opens figures on your
screen, and acts as the figure GUI manager.

pyplot is mainly intended for interactive plots and simple cases of
programmatic plot generation::

    import numpy as np
    import matplotlib.pyplot as plt

    x = np.arange(0, 5, 0.1)
    y = np.sin(x)
    plt.plot(x, y)
    plt.show()

The explicit object-oriented API is recommended for complex plots, though
pyplot is still usually used to create the figure and often the Axes in the
figure. See `.pyplot.figure`, `.pyplot.subplots`, and
`.pyplot.subplot_mosaic` to create figures, and
:doc:`Axes API </api/axes_api>` for the plotting methods on an Axes::

    import numpy as np
Repository: matplotlib/matplotlib
File: tools/boilerplate.py (Python)

Code before:
"""
Script to autogenerate pyplot wrappers.

pyplot.py consists of two parts: a hand-written part at the top, and an
automatically generated part at the bottom, starting with the comment

  ### REMAINING CONTENT GENERATED BY boilerplate.py ###

This script generates the automatically generated part of pyplot.py. It
consists of wrapper functions for methods of Figure and Axes and colormap
setter functions. Whenever the API of one of the wrapped methods changes,
this script has to be rerun to keep pyplot.py up to date.

The test ``lib/matplotlib/test_pyplot.py::test_pyplot_up_to_date`` checks
that the autogenerated part of pyplot.py is up to date. It will fail in
case of an API mismatch and remind the developer to rerun this script.
"""

# Although it is possible to dynamically generate the pyplot functions at
# runtime with the proper signatures, a static pyplot.py is simpler for static
# analysis tools to parse.

import ast
from enum import Enum
import functools
import inspect
from inspect import Parameter
from pathlib import Path
import sys
import subprocess


# This line imports the installed copy of matplotlib, and not the local copy.
import numpy as np
from matplotlib import _api, mlab
from matplotlib.axes import Axes

Review comment (suggestion):
```suggestion
consists of wrapper functions for colormap setter functions and methods of Figure and Axes. Whenever the API of one of the wrapped methods changes,
```


Code after:
"""
Script to autogenerate pyplot wrappers.

pyplot.py consists of two parts: a hand-written part at the top, and an
automatically generated part at the bottom, starting with the comment

  ### REMAINING CONTENT GENERATED BY boilerplate.py ###

This script generates the automatically generated part of pyplot.py. It
consists of colormap setter functions and wrapper functions for methods
of Figure and Axes. Whenever the API of one of the wrapped methods changes,
this script has to be rerun to keep pyplot.py up to date.

The test ``lib/matplotlib/test_pyplot.py::test_pyplot_up_to_date`` checks
that the autogenerated part of pyplot.py is up to date. It will fail in the
case of an API mismatch and remind the developer to rerun this script.
"""

# Although it is possible to dynamically generate the pyplot functions at
# runtime with the proper signatures, a static pyplot.py is simpler for static
# analysis tools to parse.

import ast
from enum import Enum
import functools
import inspect
from inspect import Parameter
from pathlib import Path
import sys
import subprocess


# This line imports the installed copy of matplotlib, and not the local copy.
import numpy as np
from matplotlib import _api, mlab
from matplotlib.axes import Axes
Repository: matplotlib/matplotlib
File: tools/boilerplate.py (Python)

Code before:
"""
Script to autogenerate pyplot wrappers.

pyplot.py consists of two parts: a hand-written part at the top, and an
automatically generated part at the bottom, starting with the comment

  ### REMAINING CONTENT GENERATED BY boilerplate.py ###

This script generates the automatically generated part of pyplot.py. It
consists of wrapper functions for methods of Figure and Axes and colormap
setter functions. Whenever the API of one of the wrapped methods changes,
this script has to be rerun to keep pyplot.py up to date.

The test ``lib/matplotlib/test_pyplot.py::test_pyplot_up_to_date`` checks
that the autogenerated part of pyplot.py is up to date. It will fail in
case of an API mismatch and remind the developer to rerun this script.
"""

# Although it is possible to dynamically generate the pyplot functions at
# runtime with the proper signatures, a static pyplot.py is simpler for static
# analysis tools to parse.

import ast
from enum import Enum
import functools
import inspect
from inspect import Parameter
from pathlib import Path
import sys
import subprocess


# This line imports the installed copy of matplotlib, and not the local copy.
import numpy as np
from matplotlib import _api, mlab
from matplotlib.axes import Axes
from matplotlib.figure import Figure


# This is the magic line that must exist in pyplot, after which the boilerplate
# content will be appended.

Review comment (bug):
```suggestion
that the autogenerated part of pyplot.py is up to date. It will fail in the 
case of an API mismatch and remind the developer to rerun this script.
```


Code after:
"""
Script to autogenerate pyplot wrappers.

pyplot.py consists of two parts: a hand-written part at the top, and an
automatically generated part at the bottom, starting with the comment

  ### REMAINING CONTENT GENERATED BY boilerplate.py ###

This script generates the automatically generated part of pyplot.py. It
consists of colormap setter functions and wrapper functions for methods
of Figure and Axes. Whenever the API of one of the wrapped methods changes,
this script has to be rerun to keep pyplot.py up to date.

The test ``lib/matplotlib/test_pyplot.py::test_pyplot_up_to_date`` checks
that the autogenerated part of pyplot.py is up to date. It will fail in the
case of an API mismatch and remind the developer to rerun this script.
"""

# Although it is possible to dynamically generate the pyplot functions at
# runtime with the proper signatures, a static pyplot.py is simpler for static
# analysis tools to parse.

import ast
from enum import Enum
import functools
import inspect
from inspect import Parameter
from pathlib import Path
import sys
import subprocess


# This line imports the installed copy of matplotlib, and not the local copy.
import numpy as np
from matplotlib import _api, mlab
from matplotlib.axes import Axes
from matplotlib.figure import Figure


# This is the magic line that must exist in pyplot, after which the boilerplate
# content will be appended.