Register the protobuf Message's name with protobuf Message
323075
public void registerOnMessage(Message.Builder builder) {
    messageMap.put(builder.getDescriptorForType().getFullName(), builder);
  }
1077383
def proto_text(self):
        
        return self.proto_template.format(type=self.type, name=self.name)
1238936
protected function registerMessageCallback()
    {
        $this->swoolePort->on('Message', function ($server, $frame) {
            $this->dispatchEvent('Message', $this->server, $this, $frame);
        });
    }
1318163
def _msg_name(self, container, max_width):
        """"""
        name = container['name']
        if len(name) > max_width:
            name = '_' + name[-max_width + 1:]
        else:
            name = name[:max_width]
        return ' {:{width}}'.format(name, width=max_width)
576032
def register_event(self, event_name, event_level, message):
        
        self.events[event_name] = (event_level, message)
173021
def MessageToJson(message, include_fields=None):
    """"""
    result = _ProtoJsonApiTools.Get().encode_message(message)
    return _IncludeFields(result, message, include_fields)
1004386
def register_type_name(t, name):
    
    assert isinstance(t, type)
    assert isinstance(name, unicode)
    __type_names[t] = name
1344062
def set_name(self, name):
        """"""
        if not name:
            name = ''
        self._client['config']['name'] = name
        yield from self._server.client_name(self.identifier, name)
599607
def _register_socket(self):
        """"""
        _socket = socket.socket(*Socket.protocols[self.connection.proto])
        _socket.settimeout(self.timeout)

        # Reconfigure original socket options.
        if self.connection.sockopts:
            for sock_opt in self.connection.sockopts:
                level, option, value = sock_opt
                _socket.setsockopt(level, option, value)

        _socket.connect(self.connection.connect_to)
        return _socket
441180
def read_prototxt(fname):
    
    proto = caffe_pb2.NetParameter()
    with open(fname, 'r') as f:
        text_format.Merge(str(f.read()), proto)
    return proto
1044798
def _register_name(self, name):
        
        if name not in self._var_name_mappers:
            self._var_name_mappers[name] = VariableNamer(name)
664947
def to_protobuf(self):
        
        key = _entity_pb2.Key()
        key.partition_id.project_id = self.project

        if self.namespace:
            key.partition_id.namespace_id = self.namespace

        for item in self.path:
            element = key.path.add()
            if "kind" in item:
                element.kind = item["kind"]
            if "id" in item:
                element.id = item["id"]
            if "name" in item:
                element.name = item["name"]

        return key
530900
def register(self, name, *slots):
        
        # setdefault initializes the object even if it exists. This is more efficient
        if name not in self:
            self[name] = Signal()

        for slot in slots:
            self[name].connect(slot)
8351
function Message(name, attrs, opts) {
  opts = opts || {};

  if (!types.isValidName(name)) {
    throw new Error(f('invalid message name: %s', name));
  }
  this._name = name;

  var recordName = f('org.apache.avro.ipc.%sRequest', name);
  this._requestType = types.createType({
    name: recordName,
    type: 'record',
    namespace: opts.namespace || '', // Don't leak request namespace.
    fields: attrs.request
  }, opts);
  // We remove the record from the registry to prevent it from being exported
  // in the protocol's schema.
  delete opts.registry[recordName];

  if (!attrs.response) {
    throw new Error('missing response');
  }
  this._responseType = types.createType(attrs.response, opts);

  var errors = attrs.errors || [];
  errors.unshift('string');
  this._errorType = types.createType(errors, opts);

  this._oneWay = !!attrs['one-way'];
  if (this._oneWay) {
    if (this._responseType.getTypeName() !== 'null' || errors.length > 1) {
      throw new Error('unapplicable one-way parameter');
    }
  }
}
1051681
def name(self):
        
        if self._proto.id.namespace:
            return self._proto.id.namespace + '/' + self._proto.id.name
        return self._proto.id.name
418706
def register(self, name: str):
        ''''''
        if name in self._callbacks:
            raise ValueError('Hook already registered')

        self._callbacks[name] = None

        if self._event_dispatcher is not None:
            self._event_dispatcher.register(name)
582984
def _update_from_pb(self, instance_pb):
        
        if not instance_pb.display_name:  # Simple field (string)
            raise ValueError("Instance protobuf does not contain display_name")
        self.display_name = instance_pb.display_name
        self.configuration_name = instance_pb.config
        self.node_count = instance_pb.node_count