code: def get_token_obj(self, token, expire=_token_default):
          if expire == _token_default:
              expire = self.get_default_token_expiration()
          now = get_time()
          until = now + expire if expire is not None else None
          with self._token_lock:
              first_valid = None
              for (pos, k) in enumerate(self._token_timings):
                  t = self._token_map[k][0]
                  if t is None or t > now:
                      first_valid = pos
                      break
              if first_valid is None:
                  self._token_map = {}
                  self._token_timings = []
              else:
                  for k in self._token_timings[:first_valid]:
                      del self._token_map[k]
                  self._token_timings = self._token_timings[first_valid:]
              if until is None or until > now:
                  if token not in self._token_map:
                      self._token_map[token] = (until, {})
                      self._token_timings.append(token)
                  else:
                      self._token_map[token] = (until, self._token_map[token][1])
                  self._token_timings.sort(key=lambda k: (
                      1 if self._token_map[k][0] is None else 0,
                      self._token_map[k][0]
                  ))
                  return self._token_map[token][1]
              else:
                  if token in self._token_map:
                      self._token_timings = [
                          k for k in self._token_timings if k != token
                      ]
                      del self._token_map[token]
                  return {}