def create_glir_message(commands, array_serialization=None):
 if (array_serialization is None):
  array_serialization = 'binary'
 (commands_modified, buffers) = _extract_buffers(commands)
 commands_serialized = [_serialize_command(command_modified) for command_modified in commands_modified]
 buffers_serialized = [_serialize_buffer(buffer, array_serialization) for buffer in buffers]
 msg = {'msg_type': 'glir_commands', 'commands': commands_serialized, 'buffers': buffers_serialized}
 return msg

def create_glir_message ( commands , array_serialization = None ) : if ( array_serialization is None ) : array_serialization = 'binary' ( commands_modified , buffers ) = _extract_buffers ( commands ) commands_serialized = [ _serialize_command ( command_modified ) for command_modified in commands_modified ] buffers_serialized = [ _serialize_buffer ( buffer , array_serialization ) for buffer in buffers ] msg = { 'msg_type' : 'glir_commands' , 'commands' : commands_serialized , 'buffers' : buffers_serialized } return msg
create a json-serializable message of glir commands .