def MakeSimpleProtoClass(fields, full_name=None, pool=None):
factory = message_factory.MessageFactory(pool=pool)<EOL>if full_name is not None:<EOL><INDENT>try:<EOL><INDENT>proto_cls = _GetMessageFromFactory(factory, full_name)<EOL>return proto_cls<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>field_items = fields.items()<EOL>if not isinstance(fields, OrderedDict):<EOL><INDENT>field_items = sorted(field_items)<EOL><DEDENT>fields_hash = hashlib.sha1()<EOL>for f_name, f_type in field_items:<EOL><INDENT>fields_hash.update(f_name.encode('<STR_LIT:utf-8>'))<EOL>fields_hash.update(str(f_type).encode('<STR_LIT:utf-8>'))<EOL><DEDENT>proto_file_name = fields_hash.hexdigest() + '<STR_LIT>'<EOL>if full_name is None:<EOL><INDENT>full_name = ('<STR_LIT>' +<EOL>fields_hash.hexdigest())<EOL>try:<EOL><INDENT>proto_cls = _GetMessageFromFactory(factory, full_name)<EOL>return proto_cls<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>factory.pool.Add(<EOL>_MakeFileDescriptorProto(proto_file_name, full_name, field_items))<EOL>return _GetMessageFromFactory(factory, full_name)<EOL>
Create a Protobuf class whose fields are basic types.

    Note: this doesn't validate field names!

    Args:
      fields: dict of {name: field_type} mappings for each field in the proto. If
          this is an OrderedDict the order will be maintained, otherwise the
          fields will be sorted by name.
      full_name: optional str, the fully-qualified name of the proto type.
      pool: optional DescriptorPool instance.
    Returns:
      a class, the new protobuf class with a FileDescriptor.