human
Complete this python program:
def compute_dependencies(tables):
assistant
#Here is the Python program you requested.

    """Construct a reverse dependency graph for the given tables.
    Returns a dict which maps a table to the list of tables which depend on it.
    """
    tables = list(tables)
    graph = {}
    def visit_foreign_key(fkey):
        if fkey.use_alter:
            return
        parent_table = fkey.column.table
        if (parent_table in tables):
            child_table = fkey.parent.table
            if (parent_table is not child_table):
                graph.setdefault(parent_table, []).append(child_table)
    for table in tables:
        visitors.traverse(table, {'schema_visitor': True}, {'foreign_key': visit_foreign_key})
        graph.setdefault(table, []).extend(table._extra_dependencies)
    return graph