code: def _string_labels_to_class_ids(
      label_vocabulary: Union[np.ndarray, List[str]], labels: np.ndarray
  ) -> np.ndarray:
      """Returns class ID for given string label using given classes or -1."""
  
      def lookup(label):
          for i, c in enumerate(label_vocabulary):
              if c == label:
                  return i
          return -1
  
      return np.array([lookup(l) for l in labels.flatten()]).reshape(
          labels.shape
      )
  
imports: import inspect
  import math
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, Union
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 22 for calling a global function with example usage: _string_labels_to_class_ids(label_vocabulary, labels) and returns: np, unknown, i