code: def predict(
      model_uri: str,
      input_data: Optional["PyFuncInput"] = None,  # noqa: F821
      input_path: Optional[str] = None,
      content_type: str = _CONTENT_TYPE_JSON,
      output_path: Optional[str] = None,
      env_manager: _EnvManager = _EnvManager.VIRTUALENV,
      install_mlflow: bool = False,
      pip_requirements_override: Optional[List[str]] = None,
  ):
      """
      Generate predictions in json format using a saved MLflow model. For information about the input
      data formats accepted by this function, see the following documentation:
      https://www.mlflow.org/docs/latest/models.html#built-in-deployment-tools.
  
      :param model_uri: URI to the model. A local path, a local or remote URI e.g. runs:/, s3://.
      :param input_data: Input data for prediction. Must be valid input for the PyFunc model.
      :param input_path: Path to a file containing input data. If provided, 'input_data' must be None.
      :param content_type: Content type of the input data. Can be one of {‘json’, ‘csv’}.
      :param output_path: File to output results to as json. If not provided, output to stdout.
      :param env_manager: Specify a way to create an environment for MLmodel inference:
  
          - virtualenv (default): use virtualenv (and pyenv for Python version management)
          - local: use the local environment
          - conda: use conda
  
      :param install_mlflow: If specified and there is a conda or virtualenv environment to be
          activated mlflow will be installed into the environment after it has been activated.
          The version of installed mlflow will be the same as the one used to invoke this command.
      :param pip_requirements_override: If specified, install the specified python dependencies to
          the model inference environment. This is particularly useful when you want to add extra
          dependencies or try different versions of the dependencies defined in the logged model.
  
      Code example:
  
      .. code-block:: python
  
          import mlflow
  
          run_id = "..."
  
          mlflow.pyfunc.predict(
              model_uri=f"runs:/{run_id}/model",
              input_data={"x": 1, "y": 2},
              content_type="json",
          )
  
          # Run prediction with additional pip dependencies
          mlflow.pyfunc.predict(
              model_uri=f"runs:/{run_id}/model",
              input_data='{"x": 1, "y": 2}',
              content_type="json",
              pip_requirements_override=["scikit-learn==0.23.2"],
          )
  
      """
      if content_type not in [_CONTENT_TYPE_JSON, _CONTENT_TYPE_CSV]:
          raise MlflowException.invalid_parameter_value(
              f"Content type must be one of {_CONTENT_TYPE_JSON} or {_CONTENT_TYPE_CSV}."
          )
  
      def _predict(_input_path: str):
          return get_flavor_backend(
              model_uri,
              env_manager=env_manager,
              install_mlflow=install_mlflow,
          ).predict(
              model_uri=model_uri,
              input_path=_input_path,
              output_path=output_path,
              content_type=content_type,
              pip_requirements_override=pip_requirements_override,
          )
  
      if input_data is not None and input_path is not None:
          raise MlflowException.invalid_parameter_value(
              "Both input_data and input_path are provided. Only one of them should be specified."
          )
      elif input_data is not None:
          input_data = _serialize_input_data(input_data, content_type)
  
          # Write input data to a temporary file
          with TempDir() as tmp:
              input_path = os.path.join(
                  tmp.path(), f"input.{content_type}"
              )
              with open(input_path, "w") as f:
                  f.write(input_data)
  
              _predict(input_path)
      else:
          _predict(input_path)
  
file_path: mlflow/mlflow/models/python_api.py
imports: import json
  import logging
  import os
  from datetime import datetime
  from io import StringIO
  from typing import ForwardRef, List, Optional, get_args, get_origin
  from mlflow.exceptions import MlflowException
  from mlflow.models.flavor_backend_registry import get_flavor_backend
  from mlflow.utils import env_manager
  from mlflow.utils.file_utils import TempDir
  from mlflow.utils.proto_json_utils import dump_input_data
label_desc: Use image node_id 2 for calling a global function with example usage: predict(model_uri, input_data, input_path, content_type, output_path, env_manager, install_mlflow, pip_requirements_override) and returns: get_flavor_backend