def _generate_download_google_link(link):
    """
    -----
    Brief
    -----
    Function that returns a direct download link of a file stored inside a Google Drive
    Repository.

    -----------
    Description
    -----------
    Generally a link from a Google Drive file is only for viewing purposes.

    If the user wants to download the file it can be done with Google Drive graphical user
    interface.

    However if we try to programmatically download the file it cannot be done with the normal url.

    So, the current function converts the "read-only" link to a downloadable format.

    ----------
    Parameters
    ----------
    link : str
        Sharable Google Drive link.

    Returns
    -------
    out : str
        Manipulated link, that ensures a direct download with wget function.
    """

    # Get file id.
    if "id=" not in link:
        # Split link into segments (split character --> /)
        split_link = link.split("/")

        file_id = split_link[-2]
    else:
        # Split link into segments (split string --> "id=")
        split_link = link.split("id=")
        file_id = split_link[-1]

    return "https://drive.google.com/uc?export=download&id=" + file_id