def all_ancestors(pathname, delim='.'):
    '\n    Return a generator of pathnames of the starting object and all of its parents.\n\n    Pathnames are ordered from longest to shortest.\n\n    Parameters\n    ----------\n    pathname : str\n        Pathname of starting object.\n    delim : str\n        Delimiter used to split the name.\n\n    Yields\n    ------\n    str\n    '
    parts = pathname.split(delim)
    for i in range(len(parts), 0, (- 1)):
        (yield delim.join(parts[:i]))
Return a generator of pathnames of the starting object and all of its parents.

Pathnames are ordered from longest to shortest.

Parameters
----------
pathname : str
    Pathname of starting object.
delim : str
    Delimiter used to split the name.

Yields
------
str
def all_ancestors(pathname, delim='.'):
    '\n    Return a generator of pathnames of the starting object and all of its parents.\n\n    Pathnames are ordered from longest to shortest.\n\n    Parameters\n    ----------\n    pathname : str\n        Pathname of starting object.\n    delim : str\n        Delimiter used to split the name.\n\n    Yields\n    ------\n    str\n    '
    parts = pathname.split(delim)
    for i in range(len(parts), 0, (- 1)):
        (yield delim.join(parts[:i]))