code: def _predict(model_uri, input_path, output_path, content_type):
      pyfunc_model = load_model(model_uri)
  
      if content_type == "json":
          if input_path is None:
              input_str = sys.stdin.read()
          else:
              with open(input_path) as f:
                  input_str = f.read()
          data, params = _split_data_and_params(input_str)
          df = infer_and_parse_data(data)
      elif content_type == "csv":
          df = (
              parse_csv_input(input_path)
              if input_path is not None
              else parse_csv_input(sys.stdin)
          )
          params = None
      else:
          raise Exception(f"Unknown content type '{content_type}'")
  
      if inspect.signature(pyfunc_model.predict).parameters.get(
          "params"
      ):
          raw_predictions = pyfunc_model.predict(df, params=params)
      else:
          _log_warning_if_params_not_in_predict_signature(
              _logger, params
          )
          raw_predictions = pyfunc_model.predict(df)
  
      if output_path is None:
          predictions_to_json(raw_predictions, sys.stdout)
      else:
          with open(output_path, "w") as fout:
              predictions_to_json(raw_predictions, fout)
  
imports: import inspect
  import json
  import logging
  import os
  import shlex
  import sys
  import traceback
  from typing import Dict, NamedTuple, Optional, Tuple
  import flask
  from mlflow.environment_variables import MLFLOW_SCORING_SERVER_REQUEST_TIMEOUT
  from mlflow.exceptions import MlflowException
  from mlflow.pyfunc.model import _log_warning_if_params_not_in_predict_signature
  from mlflow.types import ParamSchema, Schema
  from mlflow.utils import reraise
  from mlflow.utils.annotations import deprecated
  from mlflow.utils.file_utils import path_to_local_file_uri
  from mlflow.utils.os import is_windows
  from mlflow.utils.proto_json_utils import MlflowInvalidInputException, NumpyEncoder, _get_jsonable_obj, dataframe_from_parsed_json, parse_tf_serving_input
  from mlflow.version import VERSION
  from io import StringIO
  from mlflow.protos.databricks_pb2 import BAD_REQUEST, INVALID_PARAMETER_VALUE
  from mlflow.server.handlers import catch_mlflow_exception
label_desc: Use image node_id 12 for calling a global function with example usage: _predict(model_uri, input_path, output_path, content_type) without return types