##### SUMMARY

Move the remaining files needed by `ansible-test` into the `test/lib/ansible_test/` directory. This is required to implement: https://github.com/ansible/ansible/issues/59884

##### ISSUE TYPE

Feature Idea

##### COMPONENT NAME

ansible-test

"""Create a layout using the given root and paths."""
def paths_to_tree(paths):  
    """Return a filesystem tree from the given list of paths."""
    tree = {}, []
    for path in paths:
        parts = path.split(os.sep)
        root = tree
        for part in parts[:-1]:
            if part not in root[0]:
                root[0][part] = {}, []
            root = root[0][part]
        root[1].append(path)
    return tree
def get_tree_item(tree, parts):  
    """Return the portion of the tree found under the path given by parts, or None if it does not exist."""
    root = tree
    for part in parts:
        root = root[0].get(part)
        if not root:
            return None
    return root