def login(self, username=None, password=None, android_id=None):
cls_name = type(self).__name__<EOL>if username is None:<EOL><INDENT>username = input("<STR_LIT>")<EOL><DEDENT>if password is None:<EOL><INDENT>password = getpass.getpass("<STR_LIT>")<EOL><DEDENT>if android_id is None:<EOL><INDENT>android_id = Mobileclient.FROM_MAC_ADDRESS<EOL><DEDENT>try:<EOL><INDENT>self.api.login(username, password, android_id)<EOL><DEDENT>except OSError:<EOL><INDENT>logger.exception("<STR_LIT>".format(cls_name))<EOL><DEDENT>if not self.is_authenticated:<EOL><INDENT>logger.warning("<STR_LIT>".format(cls_name))<EOL>return False<EOL><DEDENT>logger.info("<STR_LIT>".format(cls_name))<EOL>return True<EOL>
Authenticate the gmusicapi Mobileclient instance.

        Parameters:
                username (Optional[str]): Your Google Music username. Will be prompted if not given.

                password (Optional[str]): Your Google Music password. Will be prompted if not given.

                android_id (Optional[str]): The 16 hex digits from an Android device ID.
                        Default: Use gmusicapi.Mobileclient.FROM_MAC_ADDRESS to create ID from computer's MAC address.

        Returns:
                ``True`` on successful login or ``False`` on unsuccessful login.