code: def unpack(self, token, **kwargs):
          
          if isinstance(token, str):
              try:
                  token = token.encode("utf-8")
              except UnicodeDecodeError:
                  pass
  
          part = split_token(token)
          self.b64part = part
          self.part = [b64d(p) for p in part]
          self.headers = json.loads(as_unicode(self.part[0]))
          for key,val in kwargs.items():
              if not val and key in self.headers:
                  continue
  
              try:
                  _ok = self.verify_header(key,val)
              except KeyError:
                  raise
              else:
                  if not _ok:
                      raise HeaderError(
                          'Expected "{}" to be "{}", was "{}"'.format(
                              key, val, self.headers[key]))
  
          return self
docs: Unpacks a JWT into its parts and base64 decodes the parts
          individually
  
          :param token: The JWT
          :param kwargs: A possible empty set of claims to verify the header
              against.