code: def is_handler_subclass(cls, classnames=("ViewHandler", "APIHandler")):
      
      if isinstance(cls, list):
          return any(is_handler_subclass(c) for c in cls)
      elif isinstance(cls, type):
          return any(c.__name__ in classnames for c in inspect.getmro(cls))
      else:
          raise TypeError(
              "Unexpected type `{}` for class `{}`".format(
                  type(cls),
                  cls
              )
          )
docs: Determines if ``cls`` is indeed a subclass of ``classnames``