Read a file of follower information and return a dictionary mapping screen_name to a set of follower ids.

def read_follower_file(fname, min_followers=0, max_followers=1e10, blacklist=set()):
    """ Read a file of follower information and return a dictionary mapping screen_name to a set of follower ids. """
    result = {}
    with open(fname, 'rt') as f:
        for line in f:
            parts = line.split()
            if len(parts) > 3:
                if parts[1].lower() not in blacklist:
                    followers = set(int(x) for x in parts[2:])
                    if len(followers) > min_followers and len(followers) <= max_followers:
                        result[parts[1].lower()] = followers
                else:
                    print('skipping exemplar', parts[1].lower())
    return result