def METHOD_NAME(docstring: str, name: str) -> str:
    """Overloads have docstrings of the form
    foo(*args, **kwargs)
    Overloaded function.
    1. foo(self: scipp._scipp.core.Variable) -> scipp._scipp.core.Variable
    Description
    2. foo(self: scipp::dataset::DataArray) -> scipp::dataset::DataArray
    Description
    """
    # Regex to match the '1. foo(self: ...' lines
    pattern = re.compile(rf'\n\d+\.\s*({name}\(.*\)\s*->.+)')
    # split and drop stuff before first overload
    overloads = pattern.split(docstring)[1:]
    return '\n'.join(
        _make_code_for_parse_single('\n'.join(overloads[i : i + 2]), name)
        for i in range(0, len(overloads), 2)
    )