def login(self, email=None, password=None, gsfId=None, authSubToken=None):
if email is not None and password is not None:<EOL><INDENT>encryptedPass = self.encryptPassword(email, password).decode('<STR_LIT:utf-8>')<EOL>params = self.deviceBuilder.getLoginParams(email, encryptedPass)<EOL>params['<STR_LIT>'] = '<STR_LIT>'<EOL>params['<STR_LIT>'] = '<STR_LIT:1>'<EOL>params['<STR_LIT>'] = '<STR_LIT>'<EOL>headers = self.deviceBuilder.getAuthHeaders(self.gsfId)<EOL>headers['<STR_LIT>'] = '<STR_LIT>'<EOL>response = requests.post(AUTH_URL, data=params, verify=ssl_verify,<EOL>proxies=self.proxies_config)<EOL>data = response.text.split()<EOL>params = {}<EOL>for d in data:<EOL><INDENT>if "<STR_LIT:=>" not in d:<EOL><INDENT>continue<EOL><DEDENT>k, v = d.split("<STR_LIT:=>", <NUM_LIT:1>)<EOL>params[k.strip().lower()] = v.strip()<EOL><DEDENT>if "<STR_LIT>" in params:<EOL><INDENT>ac2dmToken = params["<STR_LIT>"]<EOL><DEDENT>elif "<STR_LIT:error>" in params:<EOL><INDENT>if "<STR_LIT>" in params["<STR_LIT:error>"]:<EOL><INDENT>raise SecurityCheckError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>raise LoginError("<STR_LIT>" + params["<STR_LIT:error>"])<EOL><DEDENT>else:<EOL><INDENT>raise LoginError("<STR_LIT>")<EOL><DEDENT>self.gsfId = self.checkin(email, ac2dmToken)<EOL>self.getAuthSubToken(email, encryptedPass)<EOL>self.uploadDeviceConfig()<EOL><DEDENT>elif gsfId is not None and authSubToken is not None:<EOL><INDENT>self.gsfId = gsfId<EOL>self.setAuthSubToken(authSubToken)<EOL>self.search('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>raise LoginError('<STR_LIT>')<EOL><DEDENT>
Login to your Google Account.
        For first time login you should provide:
            * email
            * password
        For the following logins you need to provide:
            * gsfId
            * authSubToken