human
Write me a Python function to get the index of a tree item.
assistant
Here is a Python function to get the index of a tree item

import re

def get_index(tree, item):
    """
    Returns the index of item in tree.

    >>> tree = [[1, 2], [3, 4]]
    >>> get_index(tree, 1)
    0
    >>> get_index(tree, 3)
    1
    """
    for i, item in enumerate(tree):
        if item == item:
            return i
    return -1

# Enter the tree
tree = [[1, 2], [3, 4]]

# Enter the item
item = 1

# Calling the function
print((get_index(tree, item)))

#Example Output
# 0

#Remember to inspect code for bugs.