# Path: seaborn/_docstrings.py
# class DocstringComponents:
# 
#     regexp = re.compile(r"\n((\n|.)+)\n\s*", re.MULTILINE)
# 
#     def __init__(self, comp_dict, strip_whitespace=True):
#         """Read entries from a dict, optionally stripping outer whitespace."""
#         if strip_whitespace:
#             entries = {}
#             for key, val in comp_dict.items():
#                 m = re.match(self.regexp, val)
#                 if m is None:
#                     entries[key] = val
#                 else:
#                     entries[key] = m.group(1)
#         else:
#             entries = comp_dict.copy()
# 
#         self.entries = entries
# 
#     def __getattr__(self, attr):
#         """Provide dot access to entries for clean raw docstrings."""
#         if attr in self.entries:
#             return self.entries[attr]
#         else:
#             try:
#                 return self.__getattribute__(attr)
#             except AttributeError as err:
#                 # If Python is run with -OO, it will strip docstrings and our lookup
#                 # from self.entries will fail. We check for __debug__, which is actually
#                 # set to False by -O (it is True for normal execution).
#                 # But we only want to see an error when building the docs;
#                 # not something users should see, so this slight inconsistency is fine.
#                 if __debug__:
#                     raise err
#                 else:
#                     pass
# 
#     @classmethod
#     def from_nested_components(cls, **kwargs):
#         """Add multiple sub-sets of components."""
#         return cls(kwargs, strip_whitespace=False)
# 
#     @classmethod
#     def from_function_params(cls, func):
#         """Use the numpydoc parser to extract components from existing func."""
#         params = NumpyDocString(pydoc.getdoc(func))["Parameters"]
#         comp_dict = {}
#         for p in params:
#             name = p.name
#             type = p.type
#             desc = "\n    ".join(p.desc)
#             comp_dict[name] = f"{name} : {type}\n    {desc}"
# 
#         return cls(comp_dict)


from .._docstrings import DocstringComponents
    """An example function.

    Parameters
    ----------
    a : str
        A function parameter.

    """


class TestDocstringComponents:

    def test_from_dict(self):

        obj = DocstringComponents(EXAMPLE_DICT)
        assert obj.param_a == "a : str\n    The first parameter."

    def test_from_nested_components(self):

        obj_inner = DocstringComponents(EXAMPLE_DICT)
        obj_outer = DocstringComponents.from_nested_components(inner=obj_inner)
        assert obj_outer.inner.param_a == "a : str\n    The first parameter."

    def test_from_function(self):

        obj = DocstringComponents.from_function_params(example_func)
        assert obj.a == "a : str\n    A function parameter."

    def test_from_method(self):


# Path: seaborn/_docstrings.py
# class DocstringComponents:
# 
#     regexp = re.compile(r"\n((\n|.)+)\n\s*", re.MULTILINE)
# 
#     def __init__(self, comp_dict, strip_whitespace=True):
#         """Read entries from a dict, optionally stripping outer whitespace."""
#         if strip_whitespace:
#             entries = {}
#             for key, val in comp_dict.items():
#                 m = re.match(self.regexp, val)
#                 if m is None:
#                     entries[key] = val
#                 else:
#                     entries[key] = m.group(1)
#         else:
#             entries = comp_dict.copy()
# 
#         self.entries = entries
# 
#     def __getattr__(self, attr):
#         """Provide dot access to entries for clean raw docstrings."""
#         if attr in self.entries:
#             return self.entries[attr]
#         else:
#             try:
#                 return self.__getattribute__(attr)
#             except AttributeError as err:
#                 # If Python is run with -OO, it will strip docstrings and our lookup
#                 # from self.entries will fail. We check for __debug__, which is actually
#                 # set to False by -O (it is True for normal execution).
#                 # But we only want to see an error when building the docs;
#                 # not something users should see, so this slight inconsistency is fine.
#                 if __debug__:
#                     raise err
#                 else:
#                     pass
# 
#     @classmethod
#     def from_nested_components(cls, **kwargs):
#         """Add multiple sub-sets of components."""
#         return cls(kwargs, strip_whitespace=False)
# 
#     @classmethod
#     def from_function_params(cls, func):
#         """Use the numpydoc parser to extract components from existing func."""
#         params = NumpyDocString(pydoc.getdoc(func))["Parameters"]
#         comp_dict = {}
#         for p in params:
#             name = p.name
#             type = p.type
#             desc = "\n    ".join(p.desc)
#             comp_dict[name] = f"{name} : {type}\n    {desc}"
# 
#         return cls(comp_dict)


# Path: seaborn/tests/test_docstrings.py
from .._docstrings import DocstringComponents

    """An example function.

    Parameters
    ----------
    a : str
        A function parameter.

    """


class TestDocstringComponents:

    def test_from_dict(self):

        obj = DocstringComponents(EXAMPLE_DICT)
        assert obj.param_a == "a : str\n    The first parameter."

    def test_from_nested_components(self):

        obj_inner = DocstringComponents(EXAMPLE_DICT)
        obj_outer = DocstringComponents.from_nested_components(inner=obj_inner)
        assert obj_outer.inner.param_a == "a : str\n    The first parameter."

    def test_from_function(self):

        obj = DocstringComponents.from_function_params(example_func)
        assert obj.a == "a : str\n    A function parameter."

    def test_from_method(self):


        obj = DocstringComponents.from_function_params(