def _NewSchemaFromPb(field_type_pb_list):
 field_types = {}
 for field_type_pb in field_type_pb_list:
  for field_type in field_type_pb.type_list():
   public_type = _FIELD_TYPE_MAP[field_type]
   name = _DecodeUTF8(field_type_pb.name())
   if (name in field_types):
    field_types[name].append(public_type)
   else:
    field_types[name] = [public_type]
 return field_types

def _NewSchemaFromPb ( field_type_pb_list ) : field_types = { } for field_type_pb in field_type_pb_list : for field_type in field_type_pb . type_list ( ) : public_type = _FIELD_TYPE_MAP [ field_type ] name = _DecodeUTF8 ( field_type_pb . name ( ) ) if ( name in field_types ) : field_types [ name ] . append ( public_type ) else : field_types [ name ] = [ public_type ] return field_types
creates map of field name to type list from document_pb .