code: def is_interface(obj):
      
      return isinstance(obj, type) and issubclass(
          obj, InterfaceBase) and not (
          obj.__module__.startswith('lewis.core.devices') or obj.__module__.startswith(
              'lewis.adapters'))
docs: Returns True if obj is an interface (derived from :class:`InterfaceBase`), but not defined in
      :mod:`lewis.adapters`, where concrete interfaces for protocols are defined.
  
      :param obj: Object to test.
      :return: True if obj is an interface type.