code: def get_pool_with_descriptors(
      file_descriptors: Optional[
          descriptor_pb2.FileDescriptorSet
      ] = None,
  ) -> descriptor_pool.DescriptorPool:
      """Adds the given files to the default descriptor pool and returns it."""
      pool = descriptor_pool.Default()
      if file_descriptors:
          for file_descriptor in file_descriptors.file:
              try:
                  pool.Add(file_descriptor)
              except TypeError as e:
                  # If the same file_descriptor is already added to the current descriptor
                  # pool (and sadly there's no way to check this before calling Add()), we
                  # can ignore this.
                  if (
                      "A file with this name is already in the pool"
                      in str(e)
                  ):
                      continue
                  raise
      return pool
  
file_path: tfx/tfx/utils/proto_utils.py
imports: from typing import Any, Dict, Iterator, TypeVar, Optional
  from google.protobuf import any_pb2
  from google.protobuf import descriptor_pb2
  from google.protobuf import descriptor
  from google.protobuf import descriptor_pool
  from google.protobuf import json_format
  from google.protobuf import message
  from google.protobuf import message_factory
label_desc: Use image node_id 8 for calling a global function with example usage: get_pool_with_descriptors(file_descriptors) and returns: pool