code: async def _get_user_id(self, user, *, asdict=False):
          
          uid = self.config.user_id()
          if isinstance(user, dict):
              user_id = user.get(uid)
          elif hasattr(user, "to_dict"):
              _to_dict = await utils.call(user.to_dict)
              user_id = _to_dict.get(uid)
          else:
              raise exceptions.InvalidRetrieveUserObject()
  
          if asdict:
              return {uid: user_id}
  
          return user_id
docs: Get a user_id from a user object. If `asdict` is True, will return
          it as a dict with `config.user_id` as key. The `asdict` keyword
          defaults to `False`.