def find_jar_path():
 paths = []
 jar_file = u'py4j{0}.jar'.format(__version__)
 paths.append(jar_file)
 paths.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), (u'../../../py4j-java/' + jar_file)))
 paths.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), (u'../share/py4j/' + jar_file)))
 paths.append((u'../../../current-release/' + jar_file))
 paths.append(os.path.join(sys.prefix, (u'share/py4j/' + jar_file)))
 for path in paths:
  if os.path.exists(path):
   return path
 return u''

def find_jar_path ( ) : paths = [ ] jar_file = u'py4j{0}.jar' . format ( __version__ ) paths . append ( jar_file ) paths . append ( os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , ( u'../../../py4j-java/' + jar_file ) ) ) paths . append ( os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , ( u'../share/py4j/' + jar_file ) ) ) paths . append ( ( u'../../../current-release/' + jar_file ) ) paths . append ( os . path . join ( sys . prefix , ( u'share/py4j/' + jar_file ) ) ) for path in paths : if os . path . exists ( path ) : return path return u''
tries to find the path where the py4j jar is located .