code: def _serialize_container_factory(suffix, container_map):
      
      def serialize(ion_event):
          if not ion_event.ion_type.is_container:
              raise TypeError('Expected container type')
          return container_map[ion_event.ion_type]
      serialize.__name__ = '_serialize_container_' + suffix
      return serialize
docs: Returns a function that serializes container start/end.
  
      Args:
          suffix (str): The suffix to name the function with.
          container_map (Dictionary[core.IonType, bytes]): The
  
      Returns:
          function: The closure for serialization.