code: def _container_attrib_builder(name, container, mapper):
      
      context = {'@container': '@{0}'.format(name)}
  
      def _attrib(type, **kwargs):
          """Define a container attribute."""
          kwargs.setdefault('metadata', {})
          kwargs['metadata'][KEY_CLS] = type
          kwargs['default'] = Factory(container)
  
          def _converter(value):
              """Convert value to the given type."""
              if isinstance(value, container):
                  return mapper(type, value)
              elif value is None:
                  return value
              raise ValueError(value)
  
          kwargs.setdefault('converter', _converter)
          context_ib = context.copy()
          context_ib.update(kwargs.pop('context', {}))
          return attrib(context=context_ib, **kwargs)
  
      return _attrib
docs: Builder for container attributes.