code: def _lookup(self, bearer, target=None, permission=None):
          
  
          if target is None:
              key = (bearer, permission)
              lookup = self.bearer
  
          elif permission is None:
              key = (bearer, target)
              lookup = self.target
  
          else:
              key = (bearer, target, permission)
              lookup = self
  
          return lookup, key
docs: Lookup the proper registry for this permission.
          Returns (<registry>, <key>) where registry is the proper lookup
          and key is the generated key to use for the permission.