def is_url(string):
    """Checks if the passed string contains a valid url and nothing else. e.g. if space is included it's immediately
    invalidated the url"""
    if " " in string:
        return False
    result = urlparse(string)
    return all([result.scheme, result.netloc])
Checks if the passed string contains a valid url and nothing else. e.g. if space is included it's immediately
    invalidated the url
dpkd/transformers/src/transformers/models/idefics/processing_idefics.py