import configparser


def get_auth(f):
    """
    Get authentication token from config file
        :param f: configuration file with credentials
        :type f: file
        :returns: parsed GitHub token, False if something went wrong
        :rtype: string, bool
    """
    config = configparser.ConfigParser()
    config.read_file(f)
    if config.has_section('github') == False:
        return False
    opts = config.options('github')
    ret = ''
    for o in opts:
        if o == 'token':
            ret = config.get('github', o)
    if ret == '':
        return False
    return ret