<|file_name|>key_loader.py<|end_file_name|><｜fim▁begin｜>def load_keys(filepath):
    """
    Loads the Twitter API keys into a dict.
    :param filepath: file path to config file with Twitter API keys.
    :return: keys_dict
    :raise: IOError<｜fim▁hole｜>        keys = {}
        for line in keys_file:
            key, value = line.split('=')
            keys[key.strip()] = value.strip()
    except IOError:
        message = ('File {} cannot be opened.'
                   ' Check that it exists and is binary.')
        print message.format(filepath)
        raise
    except:
        print "Error opening or unpickling file."
        raise
    return keys<｜fim▁end｜>
    """
    try:
        keys_file = open(filepath, 'rb')