def find_up(directory, start_path):
    """
    Return true if ``start_path`` is child of the ``directory``,
    false otherwise

    ``start_path`` is the full path to a file or folder
    ``directory`` is the name of the directory to find in the path

    e.g.    find_up("foo", "/root/foo/bar") -> true
            find_up("hom", "/home/foo/bar")-> false
    """
    new_path, base_name = os.path.split(start_path)
    old_path=start_path
    # Stop the while when the root is reached
    while old_path != new_path:
        if base_name == directory:
            return True
        old_path = new_path
        new_path, base_name = os.path.split(old_path)
    return False

    Return true if ``start_path`` is child of the ``directory``,
    false otherwise

    ``start_path`` is the full path to a file or folder
    ``directory`` is the name of the directory to find in the path

    e.g.    find_up("foo", "/root/foo/bar") -> true
            find_up("hom", "/home/foo/bar")-> false
    
editorconfig/handler.py