def get_tree_tweet_edges(tree):
    """
    Input:
        - tree:
            recursive tree structure
            {tweet: "tweet_id", replies: [ .... ]}
    Output:
        - list of parent-child tweet_ids
    """
    parent_tweet_id = tree["tweet"]
    edges_to_children = []
    childrens_edges = []

    for reply in tree["replies"]:
        reply_tweet_id = reply["tweet"]

        # add an edge from the parent to the reply
        edges_to_children.append((parent_tweet_id, reply_tweet_id))

        # recursively get the edges of child
        childrens_edges += get_tree_tweet_edges(reply)

    return edges_to_children + childrens_edges