

def find_up(name, path=None):
    'Search upward from the starting path (or the current directory)\n    until the given file or directory is found. The given name is\n    assumed to be a basename, not a path.  Returns the absolute path\n    of the file or directory if found, or None otherwise.\n\n    Args\n    ----\n    name : str\n        Base name of the file or directory being searched for.\n\n    path : str, optional\n        Starting directory.  If not supplied, current directory is used.\n    '
    if (not path):
        path = os.getcwd()
    if (not exists(path)):
        return None
    while path:
        if exists(join(path, path)):
            return abspath(join(path, name))
        else:
            pth = path
            path = dirname(path)
            if (path == pth):
                return None
    return None

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/util/file_util.py find_up/VarMisuse@60/243 `name`->`path`