mds_plugin/object_store.py
def download_text_file(url):
    """Downloads a file from a given URL

    Args:
        url (str): The URL to the text file to download

    Returns:
        The contents of the file decoded to utf-8 or None
    """
    import urllib.request

    try:
        response = urllib.request.urlopen(url)
        data = response.read()
        return data.decode('utf-8')
    except urllib.error.URLError as e:
        if e.reason == 'CERTIFICATE_VERIFY_FAILED':
            try:
                install_ssl_certificates()
                response = urllib.request.urlopen(url)
                data = response.read()
                return data.decode('utf-8')
            except urllib.error.URLError as e:
                print(f"Could not download file from {url}\nERROR: {str(e)}")
        else:
            print(f"Could not download file from {url}\nERROR: {str(e)}")
Downloads a file from a given URL

    Args:
        url (str): The URL to the text file to download

    Returns:
        The contents of the file decoded to utf-8 or None
    
Downloads a file from a given URL
Downloads a file from a given URL
def download_text_file(url):
    import urllib.request
    try:
        response = urllib.request.urlopen(url)
        data = response.read()
        return data.decode('utf-8')
    except urllib.error.URLError as e:
        if e.reason == 'CERTIFICATE_VERIFY_FAILED':
            try:
                install_ssl_certificates()
                response = urllib.request.urlopen(url)
                data = response.read()
                return data.decode('utf-8')
            except urllib.error.URLError as e:
                print(f"Could not download file from {url}\nERROR: {str(e)}")
        else:
            print(f"Could not download file from {url}\nERROR: {str(e)}")
def download_text_file ( url ) : import urllib . request try : response = urllib . request . urlopen ( url ) data = response . read ( ) return data . decode ( 'utf-8' ) except urllib . error . URLError as e : if e . reason == 'CERTIFICATE_VERIFY_FAILED' : try : install_ssl_certificates ( ) response = urllib . request . urlopen ( url ) data = response . read ( ) return data . decode ( 'utf-8' ) except urllib . error . URLError as e : print ( f"Could not download file from {url}\nERROR: {str(e)}" ) else : print ( f"Could not download file from {url}\nERROR: {str(e)}" )
Downloads a file from a given URL
Downloads a file from a given URL
"""Downloads a file from a given URL

    Args:
        url (str): The URL to the text file to download

    Returns:
        The contents of the file decoded to utf-8 or None
    """
The contents of the file decoded to utf-8 or None
The contents of the file decoded to utf - 8 or None
url
The URL to the text file to download
The URL to the text file to download