code: def TFJSPredictExtractor(  # pylint: disable=invalid-name
      eval_config: config_pb2.EvalConfig,
      eval_shared_model: Union[
          types.EvalSharedModel, Dict[str, types.EvalSharedModel]
      ],
  ) -> extractor.Extractor:
      """Creates an extractor for performing predictions on tfjs models.
  
      The extractor's PTransform loads and interprets the tfjs model against
      every extract yielding a copy of the incoming extracts with an additional
      extract added for the predictions keyed by tfma.PREDICTIONS_KEY. The model
      inputs are searched for under tfma.FEATURES_KEY. If multiple
      models are used the predictions will be stored in a dict keyed by model name.
  
      Args:
        eval_config: Eval config.
        eval_shared_model: Shared model (single-model evaluation) or dict of shared
          models keyed by model name (multi-model evaluation).
  
      Returns:
        Extractor for extracting predictions.
      """
      eval_shared_models = (
          model_util.verify_and_update_eval_shared_models(
              eval_shared_model
          )
      )
  
      # pylint: disable=no-value-for-parameter
      return extractor.Extractor(
          stage_name=_TFJS_PREDICT_EXTRACTOR_STAGE_NAME,
          ptransform=_ExtractTFJSPredictions(
              eval_config=eval_config,
              eval_shared_models={
                  m.model_name: m for m in eval_shared_models
              },
          ),
      )
  
imports: import collections
  import copy
  import json
  import os
  import subprocess
  import tempfile
  from typing import Dict, List, NamedTuple, Sequence, Union
  import uuid
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.extractors.tfjs_predict_extractor_util import get_tfjs_binary
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 2 for calling a global function with example usage: TFJSPredictExtractor(eval_config, eval_shared_model) and returns: extractor