code: def _is_allowed(attr, *args):
      
      for backend in _get_backends():
          try:
              if getattr(backend, attr)(*args):
                  return True
          except AttributeError:
              raise NotImplementedError("%s.%s.%s() not implemented" % (
                  backend.__class__.__module__, backend.__class__.__name__, attr)
              )
      return False
docs: Test if a given attribute is allowed according to the
      current set of configured service backends.