code: def parse_serving_binaries(  # pylint: disable=invalid-name
      serving_spec: infra_validator_pb2.ServingSpec,
  ) -> List["ServingBinary"]:
      """Parse `ServingBinary`s from `ServingSpec`."""
      result = []
      serving_binary = serving_spec.WhichOneof("serving_binary")
      if serving_binary == "tensorflow_serving":
          config = serving_spec.tensorflow_serving
          image_name = config.image_name or None
          for tag in config.tags:
              result.append(
                  TensorFlowServing(
                      image_name=image_name,
                      model_name=serving_spec.model_name,
                      tag=tag,
                  )
              )
          for digest in config.digests:
              result.append(
                  TensorFlowServing(
                      image_name=image_name,
                      model_name=serving_spec.model_name,
                      digest=digest,
                  )
              )
          return result
      else:
          raise ValueError(
              "Invalid serving_binary {}".format(serving_binary)
          )
  
imports: import abc
  import os
  from typing import Any, Dict, List, Optional
  from docker import types
  from tfx.components.infra_validator.model_server_clients import base_client
  from tfx.components.infra_validator.model_server_clients import tensorflow_serving_client
  from tfx.proto import infra_validator_pb2
  from tfx.utils.model_paths import tf_serving_flavor
label_desc: Use image node_id 1 for calling a global function with example usage: parse_serving_binaries(serving_spec) and returns: result