def upload_to_gdrive(drive, dl_location, filename, folder_id):
    """Upload file to Google drive.
    Make sure to include the following variables wherever you call upload_to_gdrive():
    gauth = GoogleAuth()
    gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication
    drive = GoogleDrive(gauth)
    Keyword arguments:
    drive -- GoogleDrive authorize object
    dl_location -- location of file to be uploaded
    filename -- filename of file to be uploaded
    folder_id -- folder id of Google Drive folder to upload to (gotten from URL)
    """
    f = drive.CreateFile({'title': filename, 'mimeType': 'text/csv',
        'parents': [{'kind': 'drive#fileLink', 'id': folder_id}]})
    f.SetContentFile(dl_location + filename)
    f.Upload()
