code: def enforce_type(cls, jobject, intf_or_class):
          
          if not cls.check_type(jobject, intf_or_class):
              raise TypeError("Object does not implement or subclass " + intf_or_class + ": " + get_classname(jobject))
docs: Raises an exception if the object does not implement the specified interface or is not a subclass. 
  
          :param jobject: the Java object to check
          :type jobject: JB_Object
          :param intf_or_class: the classname in Java notation (eg "weka.core.DenseInstance")
          :type intf_or_class: str