def get_friends_to_friends_links(f_to_f_map, with_self_loops=True):
    """
    Returns list of tuples with links between friends:
    [
    (friend1, friend2),
    (friend1, friend10),
     ...
    (friend10, friend4)
    ]
    """
    links = []
    for friend, its_friends in f_to_f_map.items():
        for fr in its_friends:
            if friend != fr and fr in f_to_f_map.keys():
                links.append((friend, fr))
        if with_self_loops:
            links.append((friend, friend))
    return links