code: def login(self, username=None, password=None,
                section='default'):
          
          if self.has_logged_in:
              return True
          if username is None or password is None:
              credential = conf.get_credential(section)
              username = credential['username']
              password = credential['password']
  
          passport = Passport(username, password)
          r = self.http.post(LOGIN_URL, passport.form)
  
          if r.state is True:
              # Bind this passport to API
              self.passport = passport
              passport.data = r.content['data']
              self._user_id = r.content['data']['USER_ID']
              return True
          else:
              msg = None
              if 'err_name' in r.content:
                  if r.content['err_name'] == 'account':
                      msg = 'Account does not exist.'
                  elif r.content['err_name'] == 'passwd':
                      msg = 'Password is incorrect.'
              raise AuthenticationError(msg)
docs: Created the passport with ``username`` and ``password`` and log in.
          If either ``username`` or ``password`` is None or omitted, the
          credentials file will be parsed.
  
          :param str username: username to login (email, phone number or user ID)
          :param str password: password
          :param str section: section name in the credential file
          :raise: raises :class:`.AuthenticationError` if failed to login