def connect(self):
SCOPES = '<STR_LIT>'<EOL>store = file.Storage('<STR_LIT>')<EOL>creds = store.get()<EOL>if not creds or creds.invalid:<EOL><INDENT>try:<EOL><INDENT>flow = client.flow_from_clientsecrets('<STR_LIT>', SCOPES)<EOL><DEDENT>except InvalidClientSecretsError:<EOL><INDENT>log.error('<STR_LIT>')<EOL>return<EOL><DEDENT>creds = tools.run_flow(flow, store)<EOL><DEDENT>self.connection = build('<STR_LIT>', '<STR_LIT>', http=creds.authorize(Http()))<EOL>response = self.connection.files().list(q="<STR_LIT>").execute()<EOL>try:<EOL><INDENT>folder_id = response.get('<STR_LIT>', [])[<NUM_LIT:0>]['<STR_LIT:id>']<EOL><DEDENT>except IndexError:<EOL><INDENT>log.warning('<STR_LIT>')<EOL>folder_metadata = {'<STR_LIT:name>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>'}<EOL>folder = self.connection.files().create(body=folder_metadata, fields='<STR_LIT:id>').execute()<EOL><DEDENT>
Creates connection to the Google Drive API, sets the connection attribute to make requests, and creates the Music folder if it doesn't exist.