prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  MAINT: Simplify `register_method_factory`
  <!--
  Thanks for contributing a pull request!
  
  Please follow these standard acronyms to start the commit message:
  
  - ENH: enhancement
  - BUG: bug fix
  - DOC: documentation
  - TYP: type annotations
  - TST: addition or modification of tests
  - MAINT: maintenance commit (refactoring, typos, etc.)
  - BLD: change related to building
  - REL: related to releasing
  - API: an (incompatible) API change
  - DEP: deprecate something, or remove a deprecated object
  - DEV: development tool or utility
  - REV: revert an earlier commit
  - PERF: performance improvement
  - BOT: always commit via a bot
  - CI: related to CI or CD
  - CLN: Code cleanup
  -->
  
  - [ ] closes #xxxx
  - [x] whatsnew entry
  
  Delete duplicate `wraps` lines
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `dtoolkit/accessor/register.py`
  Content:
  ```
  1 from __future__ import annotations
  2 
  3 from functools import wraps
  4 from typing import Callable
  5 
  6 from pandas.api.extensions import register_dataframe_accessor
  7 from pandas.api.extensions import register_index_accessor
  8 from pandas.api.extensions import register_series_accessor
  9 from pandas.util._decorators import doc
  10 
  11 from dtoolkit._typing import SeriesOrFrame
  12 
  13 
  14 def register_method_factory(register_accessor):
  15     """
  16     Let pandas-object like accessor which only hooks class also hooks function easily.
  17 
  18     Read more in the `User Guide`_.
  19 
  20     .. _User Guide: ../../guide/tips_about_accessor.ipynb#Extend-to-Pandas-like-Object
  21 
  22     Parameters
  23     ----------
  24     register_accessor : Pandas-object like accessor
  25 
  26     See Also
  27     --------
  28     register_dataframe_method
  29     register_series_method
  30     register_index_method
  31     dtoolkit.geoaccessor.register_geoseries_method
  32     dtoolkit.geoaccessor.register_geodataframe_method
  33     """
  34 
  35     # based on pandas_flavor/register.py
  36     def register_accessor_method(method: Callable, name: str):
  37         def method_accessor(pd_obj: SeriesOrFrame):
  38             @wraps(method)
  39             def wrapper(*args, **kwargs):
  40                 return method(pd_obj, *args, **kwargs)
  41 
  42             return wrapper
  43 
  44         # Register method as pandas object inner method.
  45         register_accessor(name)(method_accessor)
  46 
  47         # Must return method itself, otherwise would get None.
  48         return method
  49 
  50     def register_accessor_alias(name: str = None):
  51         def wrapper(method: Callable):
  52             return register_accessor_method(method, name or method.__name__)
  53 
  54         return wrapper
  55 
  56     @wraps(register_accessor)
  57     def decorator(name: Callable | str = None):
  58         if callable(name):  # Supports `@register_*_method` using.
  59             method = name  # This 'name' variable actually is a function.
  60             return register_accessor_method(method, method.__name__)
  61 
  62         # Supports `@register_*_method()` and `@register_*_method(name="")` using.
  63         return register_accessor_alias(name)
  64 
  65     return decorator
  66 
  67 
  68 @register_method_factory
  69 @doc(klass=":class:`~pandas.Series`")
  70 def register_series_method(name: str = None):
  71     """
  72     {klass} register accessor for human.
  73 
  74     Write method normally, use method naturally.
  75 
  76     Read more in the `User Guide`_.
  77 
  78     .. _User Guide: ../../guide/tips_about_accessor.ipynb
  79 
  80     Parameters
  81     ----------
  82     name : str, optional
  83         Use the ``method`` name as the default accessor entrance if ``name`` is None.
  84 
  85     See Also
  86     --------
  87     register_dataframe_method
  88     register_series_method
  89     register_index_method
  90     pandas.api.extensions.register_dataframe_accessor
  91     pandas.api.extensions.register_series_accessor
  92     pandas.api.extensions.register_index_accessor
  93 
  94     Examples
  95     --------
  96     In your library code::
  97 
  98         from __future__ import annotations
  99 
  100         from dtoolkit.accessor import register_dataframe_method
  101         from dtoolkit.accessor import register_series_method
  102         from dtoolkit.accessor import register_index_method
  103         import pandas as pd
  104 
  105         @register_index_method("col")  # Support alias name also.
  106         @register_series_method("col")
  107         @register_dataframe_method(name="col")
  108         @register_index_method  # Use accessor method's `__name__` as the entrance.
  109         @register_series_method
  110         @register_dataframe_method
  111         def cols(pd_obj) -> int | str | list[int | str] | None:
  112             '''
  113             An API to gather :attr:`~pandas.Series.name` and
  114             :attr:`~pandas.DataFrame.columns` to one.
  115             '''
  116 
  117             if isinstance(pd_obj, (pd.Series, pd.Index)):
  118                 return pd_obj.name
  119 
  120             return pd_obj.columns.tolist()
  121 
  122     Back in an interactive IPython session:
  123 
  124     .. code-block:: ipython
  125 
  126         In [1]: import pandas as pd
  127 
  128         In [2]: df = pd.DataFrame(
  129            ...:     {{
  130            ...:         "a": [1, 2],
  131            ...:         "b": [3, 4],
  132            ...:     }},
  133            ...:     index=pd.Index(
  134            ...:         ["x", "y"],
  135            ...:         name="c",
  136            ...:     ),
  137            ...: )
  138 
  139         In [3]: df
  140         Out[3]:
  141            a  b
  142         c
  143         x  1  3
  144         y  2  4
  145 
  146         Get the columns of DataFrame via `cols` or `col` method
  147 
  148         In [4]: df.col()
  149         Out[4]: ['a', 'b']
  150 
  151         Get name of Series via `cols` or `col` method
  152 
  153         In [5]: df.a.col()
  154         Out[5]: 'a'
  155 
  156         Get name of Index via `cols` or `col` method
  157 
  158         In [6]: df.index.col()
  159         Out[6]: 'c'
  160     """
  161 
  162     return register_series_accessor(name)
  163 
  164 
  165 @register_method_factory
  166 @doc(register_series_method, klass=":class:`~pandas.DataFrame`")
  167 def register_dataframe_method(name: str = None):
  168     return register_dataframe_accessor(name)
  169 
  170 
  171 @register_method_factory
  172 @doc(register_series_method, klass=":class:`~pandas.Index`")
  173 def register_index_method(name: str = None):
  174     return register_index_accessor(name)
  175
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/dtoolkit/accessor/register.py b/dtoolkit/accessor/register.py
  --- a/dtoolkit/accessor/register.py
  +++ b/dtoolkit/accessor/register.py
  @@ -34,6 +34,7 @@
   
       # based on pandas_flavor/register.py
       def register_accessor_method(method: Callable, name: str):
  +        @wraps(method)
           def method_accessor(pd_obj: SeriesOrFrame):
               @wraps(method)
               def wrapper(*args, **kwargs):
  
verification_info: {"golden_diff": "diff --git a/dtoolkit/accessor/register.py b/dtoolkit/accessor/register.py\n--- a/dtoolkit/accessor/register.py\n+++ b/dtoolkit/accessor/register.py\n@@ -34,6 +34,7 @@\n \n     # based on pandas_flavor/register.py\n     def register_accessor_method(method: Callable, name: str):\n+        @wraps(method)\n         def method_accessor(pd_obj: SeriesOrFrame):\n             @wraps(method)\n             def wrapper(*args, **kwargs):\n", "issue": "MAINT: Simplify `register_method_factory`\n<!--\r\nThanks for contributing a pull request!\r\n\r\nPlease follow these standard acronyms to start the commit message:\r\n\r\n- ENH: enhancement\r\n- BUG: bug fix\r\n- DOC: documentation\r\n- TYP: type annotations\r\n- TST: addition or modification of tests\r\n- MAINT: maintenance commit (refactoring, typos, etc.)\r\n- BLD: change related to building\r\n- REL: related to releasing\r\n- API: an (incompatible) API change\r\n- DEP: deprecate something, or remove a deprecated object\r\n- DEV: development tool or utility\r\n- REV: revert an earlier commit\r\n- PERF: performance improvement\r\n- BOT: always commit via a bot\r\n- CI: related to CI or CD\r\n- CLN: Code cleanup\r\n-->\r\n\r\n- [ ] closes #xxxx\r\n- [x] whatsnew entry\r\n\r\nDelete duplicate `wraps` lines\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom functools import wraps\nfrom typing import Callable\n\nfrom pandas.api.extensions import register_dataframe_accessor\nfrom pandas.api.extensions import register_index_accessor\nfrom pandas.api.extensions import register_series_accessor\nfrom pandas.util._decorators import doc\n\nfrom dtoolkit._typing import SeriesOrFrame\n\n\ndef register_method_factory(register_accessor):\n    \"\"\"\n    Let pandas-object like accessor which only hooks class also hooks function easily.\n\n    Read more in the `User Guide`_.\n\n    .. _User Guide: ../../guide/tips_about_accessor.ipynb#Extend-to-Pandas-like-Object\n\n    Parameters\n    ----------\n    register_accessor : Pandas-object like accessor\n\n    See Also\n    --------\n    register_dataframe_method\n    register_series_method\n    register_index_method\n    dtoolkit.geoaccessor.register_geoseries_method\n    dtoolkit.geoaccessor.register_geodataframe_method\n    \"\"\"\n\n    # based on pandas_flavor/register.py\n    def register_accessor_method(method: Callable, name: str):\n        def method_accessor(pd_obj: SeriesOrFrame):\n            @wraps(method)\n            def wrapper(*args, **kwargs):\n                return method(pd_obj, *args, **kwargs)\n\n            return wrapper\n\n        # Register method as pandas object inner method.\n        register_accessor(name)(method_accessor)\n\n        # Must return method itself, otherwise would get None.\n        return method\n\n    def register_accessor_alias(name: str = None):\n        def wrapper(method: Callable):\n            return register_accessor_method(method, name or method.__name__)\n\n        return wrapper\n\n    @wraps(register_accessor)\n    def decorator(name: Callable | str = None):\n        if callable(name):  # Supports `@register_*_method` using.\n            method = name  # This 'name' variable actually is a function.\n            return register_accessor_method(method, method.__name__)\n\n        # Supports `@register_*_method()` and `@register_*_method(name=\"\")` using.\n        return register_accessor_alias(name)\n\n    return decorator\n\n\n@register_method_factory\n@doc(klass=\":class:`~pandas.Series`\")\ndef register_series_method(name: str = None):\n    \"\"\"\n    {klass} register accessor for human.\n\n    Write method normally, use method naturally.\n\n    Read more in the `User Guide`_.\n\n    .. _User Guide: ../../guide/tips_about_accessor.ipynb\n\n    Parameters\n    ----------\n    name : str, optional\n        Use the ``method`` name as the default accessor entrance if ``name`` is None.\n\n    See Also\n    --------\n    register_dataframe_method\n    register_series_method\n    register_index_method\n    pandas.api.extensions.register_dataframe_accessor\n    pandas.api.extensions.register_series_accessor\n    pandas.api.extensions.register_index_accessor\n\n    Examples\n    --------\n    In your library code::\n\n        from __future__ import annotations\n\n        from dtoolkit.accessor import register_dataframe_method\n        from dtoolkit.accessor import register_series_method\n        from dtoolkit.accessor import register_index_method\n        import pandas as pd\n\n        @register_index_method(\"col\")  # Support alias name also.\n        @register_series_method(\"col\")\n        @register_dataframe_method(name=\"col\")\n        @register_index_method  # Use accessor method's `__name__` as the entrance.\n        @register_series_method\n        @register_dataframe_method\n        def cols(pd_obj) -> int | str | list[int | str] | None:\n            '''\n            An API to gather :attr:`~pandas.Series.name` and\n            :attr:`~pandas.DataFrame.columns` to one.\n            '''\n\n            if isinstance(pd_obj, (pd.Series, pd.Index)):\n                return pd_obj.name\n\n            return pd_obj.columns.tolist()\n\n    Back in an interactive IPython session:\n\n    .. code-block:: ipython\n\n        In [1]: import pandas as pd\n\n        In [2]: df = pd.DataFrame(\n           ...:     {{\n           ...:         \"a\": [1, 2],\n           ...:         \"b\": [3, 4],\n           ...:     }},\n           ...:     index=pd.Index(\n           ...:         [\"x\", \"y\"],\n           ...:         name=\"c\",\n           ...:     ),\n           ...: )\n\n        In [3]: df\n        Out[3]:\n           a  b\n        c\n        x  1  3\n        y  2  4\n\n        Get the columns of DataFrame via `cols` or `col` method\n\n        In [4]: df.col()\n        Out[4]: ['a', 'b']\n\n        Get name of Series via `cols` or `col` method\n\n        In [5]: df.a.col()\n        Out[5]: 'a'\n\n        Get name of Index via `cols` or `col` method\n\n        In [6]: df.index.col()\n        Out[6]: 'c'\n    \"\"\"\n\n    return register_series_accessor(name)\n\n\n@register_method_factory\n@doc(register_series_method, klass=\":class:`~pandas.DataFrame`\")\ndef register_dataframe_method(name: str = None):\n    return register_dataframe_accessor(name)\n\n\n@register_method_factory\n@doc(register_series_method, klass=\":class:`~pandas.Index`\")\ndef register_index_method(name: str = None):\n    return register_index_accessor(name)\n", "path": "dtoolkit/accessor/register.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom functools import wraps\nfrom typing import Callable\n\nfrom pandas.api.extensions import register_dataframe_accessor\nfrom pandas.api.extensions import register_index_accessor\nfrom pandas.api.extensions import register_series_accessor\nfrom pandas.util._decorators import doc\n\nfrom dtoolkit._typing import SeriesOrFrame\n\n\ndef register_method_factory(register_accessor):\n    \"\"\"\n    Let pandas-object like accessor which only hooks class also hooks function easily.\n\n    Read more in the `User Guide`_.\n\n    .. _User Guide: ../../guide/tips_about_accessor.ipynb#Extend-to-Pandas-like-Object\n\n    Parameters\n    ----------\n    register_accessor : Pandas-object like accessor\n\n    See Also\n    --------\n    register_dataframe_method\n    register_series_method\n    register_index_method\n    dtoolkit.geoaccessor.register_geoseries_method\n    dtoolkit.geoaccessor.register_geodataframe_method\n    \"\"\"\n\n    # based on pandas_flavor/register.py\n    def register_accessor_method(method: Callable, name: str):\n        @wraps(method)\n        def method_accessor(pd_obj: SeriesOrFrame):\n            @wraps(method)\n            def wrapper(*args, **kwargs):\n                return method(pd_obj, *args, **kwargs)\n\n            return wrapper\n\n        # Register method as pandas object inner method.\n        register_accessor(name)(method_accessor)\n\n        # Must return method itself, otherwise would get None.\n        return method\n\n    def register_accessor_alias(name: str = None):\n        def wrapper(method: Callable):\n            return register_accessor_method(method, name or method.__name__)\n\n        return wrapper\n\n    @wraps(register_accessor)\n    def decorator(name: Callable | str = None):\n        if callable(name):  # Supports `@register_*_method` using.\n            method = name  # This 'name' variable actually is a function.\n            return register_accessor_method(method, method.__name__)\n\n        # Supports `@register_*_method()` and `@register_*_method(name=\"\")` using.\n        return register_accessor_alias(name)\n\n    return decorator\n\n\n@register_method_factory\n@doc(klass=\":class:`~pandas.Series`\")\ndef register_series_method(name: str = None):\n    \"\"\"\n    {klass} register accessor for human.\n\n    Write method normally, use method naturally.\n\n    Read more in the `User Guide`_.\n\n    .. _User Guide: ../../guide/tips_about_accessor.ipynb\n\n    Parameters\n    ----------\n    name : str, optional\n        Use the ``method`` name as the default accessor entrance if ``name`` is None.\n\n    See Also\n    --------\n    register_dataframe_method\n    register_series_method\n    register_index_method\n    pandas.api.extensions.register_dataframe_accessor\n    pandas.api.extensions.register_series_accessor\n    pandas.api.extensions.register_index_accessor\n\n    Examples\n    --------\n    In your library code::\n\n        from __future__ import annotations\n\n        from dtoolkit.accessor import register_dataframe_method\n        from dtoolkit.accessor import register_series_method\n        from dtoolkit.accessor import register_index_method\n        import pandas as pd\n\n        @register_index_method(\"col\")  # Support alias name also.\n        @register_series_method(\"col\")\n        @register_dataframe_method(name=\"col\")\n        @register_index_method  # Use accessor method's `__name__` as the entrance.\n        @register_series_method\n        @register_dataframe_method\n        def cols(pd_obj) -> int | str | list[int | str] | None:\n            '''\n            An API to gather :attr:`~pandas.Series.name` and\n            :attr:`~pandas.DataFrame.columns` to one.\n            '''\n\n            if isinstance(pd_obj, (pd.Series, pd.Index)):\n                return pd_obj.name\n\n            return pd_obj.columns.tolist()\n\n    Back in an interactive IPython session:\n\n    .. code-block:: ipython\n\n        In [1]: import pandas as pd\n\n        In [2]: df = pd.DataFrame(\n           ...:     {{\n           ...:         \"a\": [1, 2],\n           ...:         \"b\": [3, 4],\n           ...:     }},\n           ...:     index=pd.Index(\n           ...:         [\"x\", \"y\"],\n           ...:         name=\"c\",\n           ...:     ),\n           ...: )\n\n        In [3]: df\n        Out[3]:\n           a  b\n        c\n        x  1  3\n        y  2  4\n\n        Get the columns of DataFrame via `cols` or `col` method\n\n        In [4]: df.col()\n        Out[4]: ['a', 'b']\n\n        Get name of Series via `cols` or `col` method\n\n        In [5]: df.a.col()\n        Out[5]: 'a'\n\n        Get name of Index via `cols` or `col` method\n\n        In [6]: df.index.col()\n        Out[6]: 'c'\n    \"\"\"\n\n    return register_series_accessor(name)\n\n\n@register_method_factory\n@doc(register_series_method, klass=\":class:`~pandas.DataFrame`\")\ndef register_dataframe_method(name: str = None):\n    return register_dataframe_accessor(name)\n\n\n@register_method_factory\n@doc(register_series_method, klass=\":class:`~pandas.Index`\")\ndef register_index_method(name: str = None):\n    return register_index_accessor(name)\n", "path": "dtoolkit/accessor/register.py"}]}