code: def token(self, adata, load):
          '''
          Determine if token auth is valid and yield the adata
          '''
          try:
              token = self.loadauth.get_tok(load['token'])
          except Exception as exc:
              log.error('Exception occurred when generating auth token: %s', exc)
              yield {}
          if not token:
              log.warning('Authentication failure of type "token" occurred.')
              yield {}
          for sub_auth in adata:
              for sub_adata in adata:
                  if token['eauth'] not in adata:
                      continue
              if not ((token['name'] in adata[token['eauth']]) |
                      ('*' in adata[token['eauth']])):
                  continue
              yield {'sub_auth': sub_auth, 'token': token}
          yield {f token(self, adata, load):
          '''
          Determine if token auth is valid and yield the adata
          '''
          try:
              token = self.loadauth.get_tok(load['token'])
          except Exception as exc:
              log.error('Exception occurred when generating auth token: %s', exc)
              yield {}
          if not token:
              log.warning('Authentication failure of type "token" occurred.')
              yield {}
          for sub_auth in adata:
              for sub_adata in adata:
                  if token['eauth'] not in adata:
                      continue
              if not ((token['name'] in adata[token['eauth']]) |
                      ('*' in adata[token['eauth']])):
                  continue
              yield {'sub_auth': sub_auth, 'token': token}
          yield {}
docs: Determine if token auth is valid and yield the adata