code: def predictor_from_json_ai(json_ai: JsonAI) -> PredictorInterface:
      """
      Creates a ready-to-train ``Predictor`` object based on the details you specified inside your JsonAI.
  
      :param json_ai: A ``JsonAI`` object
  
      :returns: A lightwood ``Predictor`` object
      """  # noqa
      code = code_from_json_ai(json_ai)
      predictor = predictor_from_code(code)
      return predictor
  
imports: import os
  from typing import Union
  import dill
  import pandas
  from lightwood.api.types import JsonAI, ProblemDefinition
  from dataprep_ml.insights import statistical_analysis
  from type_infer.api import infer_types
  from lightwood.api.predictor import PredictorInterface
  from lightwood.api.json_ai import generate_json_ai
  from lightwood.helpers.codegen import code_from_json_ai, _module_from_code, _predictor_from_code
  import sys
  import gc
  import time
  from lightwood.helpers.log import log
  from shutil import copyfile
label_desc: Use image node_id 8 for calling a global function with example usage: predictor_from_json_ai(json_ai) and returns: predictor