Create a new Message instance for the given type.

        Args:
            msgtype (str) :
773490
def create(self, msgtype, *args, **kwargs):
        ''' 

        '''
        if msgtype not in self._messages:
            raise ProtocolError("Unknown message type %r for protocol version %s" % (msgtype, self._version))
        return self._messages[msgtype].create(*args, **kwargs)
385170
public MessageRecordDesc createNewMessage(BaseMessage message, String strKey)
    {
        MessageRecordDesc messageData = null;
        String strClassName = this.getField(MessageInfo.MESSAGE_CLASS).toString();
        messageData = (MessageRecordDesc)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName);
        if (messageData != null)
               messageData.init(message, strKey);
        return messageData;
    }
1159052
private function craft_new_msg($type, $jobId, $client, $data)
    {
        // Add client info to data
        $data->{'client'} = $client;
        // Build msg to send out
        $msg = array(
            'time'   => microtime(true),
            'type'   => $type,
            'jobId'  => $jobId,
            'data'   => $data
        );

        return $msg;
    }
1163401
def load(cls, bmessage):
        
        message_dict = msgpack.loads(bmessage, encoding="utf8", use_list=False)

        try:
            obj = MessageMeta._registered_messages[message_dict["type"]].__new__(MessageMeta._registered_messages[message_dict["type"]])
            object.__setattr__(obj, "__dict__", message_dict)
        except:
            raise TypeError("Unknown message type") from None

        if not obj._verify():  # pylint: disable=protected-access
            raise TypeError("Invalid message content")

        return obj
1302709
@SuppressWarnings({"unchecked"})
  public static <T extends MessageBundle> T create(final Class<T> type) {
    checkNotNull(type);
    return (T) Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, new Handler(type));
  }
1063807
public void addTypeType(String version, TTypes TTypes, MessageProcessInfo recMessageProcessInfo)
    {
        // Create the types (import the OTA specs)
        MessageInfo recMessageInfo = this.getMessageIn(recMessageProcessInfo);
        if (recMessageInfo != null)
        {
            String name = this.fixName(recMessageInfo.getField(MessageInfo.DESCRIPTION).toString());
            if (this.isNewType(name))
            {
                this.addSchema(version, TTypes, recMessageInfo);
            }
        }
        recMessageInfo = this.getMessageOut(recMessageProcessInfo);
        if (recMessageInfo != null)
        {
            String name = this.fixName(recMessageInfo.getField(MessageInfo.DESCRIPTION).toString());
            if (this.isNewType(name))
            {
                this.addSchema(version, TTypes, recMessageInfo);
            }
        }
    }
1283734
def create_inst(inst_type, **init_args):
    ''''''
    args, kwargs = get_init_args(inst_type, init_args)
    return inst_type(*args, **kwargs)
1188347
def send_msg(self, chat_id, msg_type, **kwargs):
        
        return self.send(chat_id, msg_type, **kwargs)
828485
public void addMessageType(String version, TDefinitions descriptionType, MessageProcessInfo recMessageProcessInfo)
    {
        // Create the types (import the OTA specs)
        MessageInfo recMessageInfo = this.getMessageIn(recMessageProcessInfo);
        if (recMessageInfo != null)
        {
            String name = this.fixName(recMessageInfo.getField(MessageInfo.DESCRIPTION).toString());
            if (this.isNewType(name))
            {
                this.addMessage(version, descriptionType, recMessageInfo);
            }
        }
        recMessageInfo = this.getMessageOut(recMessageProcessInfo);
        if (recMessageInfo != null)
        {
            String name = this.fixName(recMessageInfo.getField(MessageInfo.DESCRIPTION).toString());
            if (this.isNewType(name))
            {
                this.addMessage(version, descriptionType, recMessageInfo);
            }
        }
    }
1213839
def create(message_type, priority=0):
    """"""
    message = protobuf.ProtocolMessage()
    message.type = message_type
    message.priority = priority
    return message
1119688
def send(self,message,message_type,topic=''):
        
        if message_type == RAW:
            self._sock.send(message)
        elif message_type == PYOBJ:
            self._sock.send_pyobj(message)
        elif message_type == JSON:
            self._sock.send_json(message)
        elif message_type == MULTIPART:
            self._sock.send_multipart([topic, message])
        elif message_type == STRING:
            self._sock.send_string(message)
        elif message_type == UNICODE:
            self._sock.send_unicode(message)
        else:
            raise Exception("Unknown message type %s"%(message_type,))
562358
def sendmess(self, msgtype, payload, flags=0, size=0, offset=0, timeout=0):
        

        flags |= self.flags
        assert not (flags & FLG_PERSISTENCE)

        with self._new_connection() as conn:
            ret, _, data = conn.req(
                msgtype, payload, flags, size, offset, timeout)

        return ret, data
976611
def report_message_type(self, msg):
        
        desc = get_message_description(self.linter, msg.msg_id)
        self.tc.message('inspectionType', id=msg.msg_id, name=msg.symbol, description=desc, category=msg.category)
1188702
def add_messages(self, validation):
        
        if not isinstance(validation, Validation):
            raise TypeError("Argument must be of type Validation")

        self.messages.extend(validation.messages)
1218383
def _import_message(self, type_name):
        # type: (d.FieldDescriptorProto) -> Text
        """"""
        name = cast(Text, type_name)

        if name[0] == '.' and name[1].isupper() and name[2].islower():
            # Message defined in this file
            return name[1:]

        message_fd = self.descriptors.message_to_fd[name]
        if message_fd.name == self.fd.name:
            # message defined in this package
            split = name.split('.')
            for i, segment in enumerate(split):
                if segment and segment[0].isupper() and segment[1].islower():
                    return ".".join(split[i:])

        # Not in package. Must import
        split = name.split(".")
        for i, segment in enumerate(split):
            if segment and segment[0].isupper() and segment[1].islower():
                assert message_fd.name.endswith('.proto')
                import_name = self._import(message_fd.name[:-6].replace('-', '_') + "_pb2", segment)
                remains = ".".join(split[i + 1:])
                if not remains:
                    return import_name
                raise AssertionError("Don't support nested imports yet")
                # return new_nested_import(import_name, remains)

        raise AssertionError("Could not parse local name " + name)
925149
@SuppressWarnings("unchecked")
  private static <Type extends Message> Type copyAsType(
      final Type typeDefaultInstance, final Message source) {
    return (Type)typeDefaultInstance.newBuilderForType()
                                    .mergeFrom(source)
                                    .build();
  }
1092545
function type(type) {
  return function(title, msg){
    return exports.notify.apply(this, arguments)
      .type(type);
  }
}