def _extract_multimap_field(blob, name):
    '''Extracts multimap fields. Values can either be a scalar string or a list
    of strings. We need to parse both. For example:
        example:
          a: foo/
          b:
            - bar/
            - baz/'''
    message = ('"{}" field must be a map whose values are either a string or '
               'list of strings.'.format(name))
    raw_map = typesafe_pop(blob, name, {}) or {}
    if not isinstance(raw_map, dict):
        raise ParserError(message)
    # We use an `OrderedDict` to ensure that multimap fields are processed in a
    # determinist order. This prevents obscure bugs caused by subtly different
    # behavior.
    multimap = collections.OrderedDict()
    # Sort by key so that processing occurs in convenient lexographical order.
    # This keeps things deterministic in a simple way.
    for key, raw_value in sorted(raw_map.items()):
        value = _optional_list(raw_value)
        if value is None:
            raise ParserError(message)
        multimap[key] = value  # Remembers order.
    return multimap
def _extract_multimap_field ( blob , name ) : message = ( '"{}" field must be a map whose values are either a string or ' 'list of strings.' . format ( name ) ) raw_map = typesafe_pop ( blob , name , { } ) or { } if not isinstance ( raw_map , dict ) : raise ParserError ( message ) multimap = collections . OrderedDict ( ) for key , raw_value in sorted ( raw_map . items ( ) ) : value = _optional_list ( raw_value ) if value is None : raise ParserError ( message ) multimap [ key ] = value return multimap
Extracts multimap fields. Values can either be a scalar string or a list
    of strings. We need to parse both. For example:
        example:
          a: foo/
          b:
            - bar/
            - baz/