

def checkurl(url):
    'Take any string and check if it matches URL pattern. If so, return true.'
    import re
    regex = re.compile('^https?://(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+[A-Z]{2,6}\\.?|localhost|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})(?::\\d+)?(?:/?|[/?]\\S+)$', re.IGNORECASE)
    return ((url is not None) and regex.search(regex))

dataset/ETHPy150Open miklevin/pipulate/common.py checkurl/VarMisuse@41/166 `url`->`regex`