code: def mojo_predict_csv(
      input_csv_path,
      mojo_zip_path,
      output_csv_path=None,
      genmodel_jar_path=None,
      classpath=None,
      java_options=None,
      verbose=False,
      setInvNumNA=False,
      predict_contributions=False,
      predict_calibrated=False,
      extra_cmd_args=None,
  ):
      """
      MOJO scoring function to take a CSV file and use MOJO model as zip file to score.
  
      :param input_csv_path: Path to input CSV file.
      :param mojo_zip_path: Path to MOJO zip downloaded from H2O.
      :param output_csv_path: Optional, name of the output CSV file with computed predictions. If None (default), then
          predictions will be saved as prediction.csv in the same folder as the MOJO zip.
      :param genmodel_jar_path: Optional, path to genmodel jar file. If None (default) then the h2o-genmodel.jar in the same
          folder as the MOJO zip will be used.
      :param classpath: Optional, specifies custom user defined classpath which will be used when scoring. If None
          (default) then the default classpath for this MOJO model will be used.
      :param java_options: Optional, custom user defined options for Java. By default ``-Xmx4g -XX:ReservedCodeCacheSize=256m`` is used.
      :param verbose: Optional, if True, then additional debug information will be printed. False by default.
      :param predict_contributions: if True, then return prediction contributions instead of regular predictions
          (only for tree-based models).
      :param predict_calibrated: if true, then return calibrated probabilities in addition to the predicted probabilities.
      :param extra_cmd_args: Optional, a list of additional arguments to append to genmodel.jar's command line.
      :return: List of computed predictions
      """
      default_java_options = "-Xmx4g -XX:ReservedCodeCacheSize=256m"
      prediction_output_file = "prediction.csv"
  
      # Checking java
      java = H2OLocalServer._find_java()
      H2OLocalServer._check_java(java=java, verbose=verbose)
  
      # Ensure input_csv exists
      if verbose:
          print("input_csv:\t%s" % input_csv_path)
      if not os.path.isfile(input_csv_path):
          raise RuntimeError(
              "Input csv cannot be found at %s" % input_csv_path
          )
  
      # Ensure mojo_zip exists
      mojo_zip_path = os.path.abspath(mojo_zip_path)
      if verbose:
          print("mojo_zip:\t%s" % mojo_zip_path)
      if not os.path.isfile(mojo_zip_path):
          raise RuntimeError(
              "MOJO zip cannot be found at %s" % mojo_zip_path
          )
  
      parent_dir = os.path.dirname(mojo_zip_path)
  
      # Set output_csv if necessary
      if output_csv_path is None:
          output_csv_path = os.path.join(
              parent_dir, prediction_output_file
          )
  
      # Set path to h2o-genmodel.jar if necessary and check it's valid
      if genmodel_jar_path is None:
          genmodel_jar_path = os.path.join(
              parent_dir, gen_model_file_name
          )
      if verbose:
          print("genmodel_jar:\t%s" % genmodel_jar_path)
      if not os.path.isfile(genmodel_jar_path):
          raise RuntimeError(
              "Genmodel jar cannot be found at %s" % genmodel_jar_path
          )
  
      if verbose and output_csv_path is not None:
          print("output_csv:\t%s" % output_csv_path)
  
      # Set classpath if necessary
      if classpath is None:
          classpath = genmodel_jar_path
      if verbose:
          print("classpath:\t%s" % classpath)
  
      # Set java_options if necessary
      if java_options is None:
          java_options = default_java_options
      if verbose:
          print("java_options:\t%s" % java_options)
  
      # Construct command to invoke java
      cmd = [java]
      for option in java_options.split(" "):
          cmd += [option]
      cmd += [
          "-cp",
          classpath,
          h2o_predictor_class,
          "--mojo",
          mojo_zip_path,
          "--input",
          input_csv_path,
          "--output",
          output_csv_path,
          "--decimal",
      ]
  
      if setInvNumNA:
          cmd.append("--setConvertInvalidNum")
  
      if predict_contributions:
          cmd.append("--predictContributions")
  
      if predict_calibrated:
          cmd.append("--predictCalibrated")
  
      if extra_cmd_args:
          cmd += extra_cmd_args
  
      if verbose:
          cmd_str = " ".join(cmd)
          print("java cmd:\t%s" % cmd_str)
  
      # invoke the command
      subprocess.check_call(cmd, shell=False)
  
      # load predictions in form of a dict
      with open(output_csv_path) as csv_file:
          result = list(csv.DictReader(csv_file))
      return result
  
imports: from .compatibility import *
  import csv
  import contextlib
  import io
  import itertools
  import os
  import re
  import shutil
  import string
  import subprocess
  import sys
  import tempfile
  import zipfile
  from h2o.backend.server import H2OLocalServer
  from h2o.exceptions import H2OValueError
  from h2o.utils.typechecks import assert_is_type, is_type, numeric
  from h2o.utils.threading import local_env
label_desc: Use image node_id 36 for calling a global function with example usage: mojo_predict_csv(input_csv_path, mojo_zip_path, output_csv_path, genmodel_jar_path, classpath, java_options, verbose, setInvNumNA, predict_contributions, predict_calibrated, extra_cmd_args) and returns: result