def is_instance_of(gateway, java_object, java_class):
 if isinstance(java_class, basestring):
  param = java_class
 elif isinstance(java_class, JavaClass):
  param = java_class._fqn
 elif isinstance(java_class, JavaObject):
  param = java_class.getClass()
 else:
  raise Py4JError(u'java_class must be a string, a JavaClass, or a JavaObject')
 return gateway.jvm.py4j.reflection.TypeUtil.isInstanceOf(param, java_object)

def is_instance_of ( gateway , java_object , java_class ) : if isinstance ( java_class , basestring ) : param = java_class elif isinstance ( java_class , JavaClass ) : param = java_class . _fqn elif isinstance ( java_class , JavaObject ) : param = java_class . getClass ( ) else : raise Py4JError ( u'java_class must be a string, a JavaClass, or a JavaObject' ) return gateway . jvm . py4j . reflection . TypeUtil . isInstanceOf ( param , java_object )
indicates whether a java object is an instance of the provided java_class .