def SplitJar(input_jar, output_directory, maximum_size=sys.maxint,
             include_predicate=lambda name: True):
  if not input_jar.lower().endswith('.jar'):
    raise ValueError('Does not end with .jar: %s' % input_jar)

  base_name = os.path.splitext(os.path.basename(input_jar))[0]
  with _Maker(output_directory, base_name, maximum_size) as maker:
    for name, contents in JarContents(input_jar):
      if (name != 'META-INF/MANIFEST.MF' and name != 'INDEX.LIST' and
          include_predicate(name)):
        size = len(contents)
        if size > maximum_size:
          raise JarWriteError(
              'Entry %s in %s has size %d which is bigger than the maximum jar '
              'size %d' % (name, input_jar, size, maximum_size))
        maker.WriteStr(name, contents)
Return a function to install the reactor most suited for the given platform.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/jarfile.py/SplitJar--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/internet/default.py/_getInstallFunction