code: def get_predictor(model, preproc, batch_size=U.DEFAULT_BS):
      """
      ```
      Returns a Predictor instance that can be used to make predictions on
      unlabeled examples.  Can be saved to disk and reloaded as part of a
      larger application.
  
      Args
          model (Model):        A compiled instance of keras.engine.training.Model
          preproc(Preprocessor):   An instance of TextPreprocessor,ImagePreprocessor,
                                   or NERPreprocessor.
                                   These instances are returned from the data loading
                                   functions in the ktrain vision and text modules:
  
                                   ktrain.vision.images_from_folder
                                   ktrain.vision.images_from_csv
                                   ktrain.vision.images_from_array
                                   ktrain.text.texts_from_folder
                                   ktrain.text.texts_from_csv
                                   ktrain.text.ner.entities_from_csv
          batch_size(int):    batch size to use.  default:32
      ```
      """
  
      # check arguments
      if not isinstance(model, keras.Model):
          raise ValueError("model must be of instance keras.Model")
      if not isinstance(
          preproc,
          (
              ImagePreprocessor,
              TextPreprocessor,
              NERPreprocessor,
              NodePreprocessor,
              LinkPreprocessor,
              TabularPreprocessor,
          ),
      ):
          raise ValueError(
              "preproc must be instance of ktrain.preprocessor.Preprocessor"
          )
      if isinstance(preproc, ImagePreprocessor):
          return ImagePredictor(model, preproc, batch_size=batch_size)
      elif isinstance(preproc, TextPreprocessor):
          # elif type(preproc).__name__ == 'TextPreprocessor':
          return TextPredictor(model, preproc, batch_size=batch_size)
      elif isinstance(preproc, NERPreprocessor):
          return NERPredictor(model, preproc, batch_size=batch_size)
      elif isinstance(preproc, NodePreprocessor):
          return NodePredictor(model, preproc, batch_size=batch_size)
      elif isinstance(preproc, LinkPreprocessor):
          return LinkPredictor(model, preproc, batch_size=batch_size)
      elif isinstance(preproc, TabularPreprocessor):
          return TabularPredictor(model, preproc, batch_size=batch_size)
  
      else:
          raise Exception(
              "preproc of type %s not currently supported"
              % (type(preproc))
          )
  
imports: from .None import utils
  from .graph.predictor import LinkPredictor, NodePredictor
  from .graph.preprocessor import LinkPreprocessor, NodePreprocessor
  from .imports import *
  from .lroptimize.lrfinder import *
  from .tabular.predictor import TabularPredictor
  from .tabular.preprocessor import TabularPreprocessor
  from .text.ner.predictor import NERPredictor
  from .text.ner.preprocessor import NERPreprocessor
  from .text.predictor import TextPredictor
  from .text.preprocessor import BERTPreprocessor, TextPreprocessor, TransformersPreprocessor
  from .vision.predictor import ImagePredictor
  from .vision.preprocessor import ImagePreprocessor
label_desc: Use image node_id 1 for calling a global function with example usage: get_predictor(model, preproc, batch_size) and returns: ImagePredictor, TextPredictor, NERPredictor, NodePredictor, LinkPredictor, TabularPredictor