def url_or_file(string):
    if re.match('https?://', string, re.IGNORECASE):
        return {'url': string}
    else:
        return {'file': string}
def url_or_file(string):
    if re.match('https?://', string, re.IGNORECASE):
        return {'url': string}
    else:
        return {'file': string}