Decodes a sequence command from an array of bytes, according to the
    given command dictionary, and returns a new SeqCmd.
185802
def decode (cls, bytes, cmddict):
    
    attrs = SeqCmdAttrs.decode(bytes[0:1])
    delay = SeqDelay   .decode(bytes[1:4])
    cmd   = cmddict    .decode(bytes[4:] )
    return cls(cmd, delay, attrs)
332793
def command_run(self, command):
        
        # convert the command to sequence if a string
        if isinstance(command, basestring):
            command = shlex.split(command)
        try:
            return Popen(command, stdout=PIPE, stderr=PIPE, close_fds=True).wait()
        except Exception as e:
            # make a pretty command for error loggings and...
            if isinstance(command, basestring):
                pretty_cmd = command
            else:
                pretty_cmd = " ".join(command)
            msg = "Command `{cmd}` {error}".format(cmd=pretty_cmd, error=e.errno)
            raise exceptions.CommandError(msg, error_code=e.errno)
165069
def from_sequence(cls, seq, order=None, **kwargs):
        """"""
        for arg in seq:
            yield cls(arg, order=order, **kwargs)
1352163
@Override
	public T decode(byte[] bytes) throws IOException {
		if (bytes == null) {
			throw new IOException("byte array is null.");
		}
		CodedInputStream input = CodedInputStream.newInstance(bytes, 0, bytes.length);

		return readFrom(input);
	}
664056
def decode_base64_dict(data):
    ''' 

    '''
    b64 = base64.b64decode(data['__ndarray__'])
    array = np.copy(np.frombuffer(b64, dtype=data['dtype']))
    if len(data['shape']) > 1:
        array = array.reshape(data['shape'])
    return array
678964
def parse (cls, line, lineno, log, cmddict=None):
    
    start  = line.find('%')
    pos    = SeqPos(line, lineno, start + 1, len(line))
    result = None

    if start >= 0:
      result = cls(line[start:], pos)

    return result
458262
def parse_command(self, string):
        """"""
        possible_command, _, rest = string.partition(" ")
        # Commands are case-insensitive, stored as lowercase
        possible_command = possible_command.lower()
        if possible_command not in self.commands:
            return None, None

        event = self.commands[possible_command]["event"]
        args = shlex.split(rest.strip())
        return event, args
1149925
def command_packet(cmd):
    
    return message('Command',
                   Container(string_length=len(cmd),
                             string=bytes(cmd, ENCODING)),
                   len(cmd) + 2)
951965
def split_command(self, command):
        """"""
        encoded = self.encode_utf8(command)

        try:
            splitted = [s.replace("??", "\\ ") for s in shlex.split(encoded.replace('\\ ', '??'))]
        except ValueError:
            splitted = encoded.split(' ')

        return self.decode_utf8(splitted)
550701
def decodepackbits(encoded):
    
    func = ord if sys.version[0] == '2' else lambda x: x
    result = []
    i = 0
    try:
        while True:
            n = func(encoded[i]) + 1
            i += 1
            if n < 129:
                result.extend(encoded[i:i+n])
                i += n
            elif n > 129:
                result.extend(encoded[i:i+1] * (258-n))
                i += 1
    except IndexError:
        pass
    return b''.join(result) if sys.version[0] == '2' else bytes(result)
918173
function parseCommand(data) {
  var command,
      str = data.toString('utf8', 0, data.length);

  command = str.split('\n');
  return command[0];
}
595658
def decode_nfo( buffer ):
    """"""
    assert utils.is_bytes( buffer )
    return '\n'.join( [''.join( [CP437[y] for y in x] ) for x in buffer.split( b'\r\n' )] )
1258533
def parse_commands(command)
      case command
      when Array
        command.map { |line| line.to_s }
      when String
        command.enum_for(:each_line).map { |line| line.chomp }
      else
        raise(InvalidConfig,"commands must be an Array or a String")
      end
    end
305987
def command(self, command, value=1, check=True, allowable_errors=None,
                codec_options=DEFAULT_CODEC_OPTIONS, _deadline=None, **kwargs):
        """"""
        if isinstance(command, (bytes, unicode)):
            command = SON([(command, value)])
        options = kwargs.copy()
        command.update(options)

        def on_ok(response):
            if check:
                msg = "TxMongo: command {0} on namespace {1} failed with '%s'".format(repr(command), ns)
                _check_command_response(response, msg, allowable_errors)

            return response

        ns = self["$cmd"].with_options(codec_options=codec_options)
        return ns.find_one(command, _deadline=_deadline).addCallback(on_ok)
21393
def split_command(cmd, posix=None):
    '''
     
    '''
    if not isinstance(cmd, string_types):
        # cmd is string list
        pass
    else:
        if not PY3:
            # cmd is string
            # The shlex module currently does not support Unicode input (in
            # 2.x)!
            if isinstance(cmd, unicode):
                try:
                    cmd = unicodedata.normalize(
                        'NFKD', cmd).encode('ascii', 'strict')
                except UnicodeEncodeError:
                    raise EasyProcessUnicodeError('unicode command "%s" can not be processed.' % cmd +
                                                  'Use string list instead of string')
                log.debug('unicode is normalized')
        if posix is None:
            posix = 'win' not in sys.platform
        cmd = shlex.split(cmd, posix=posix)
    return cmd
566017
def decodeElem(self, bytes, index, raw=False):
        
        self._assertIndex(index)
        start = index * self.type.nbytes
        stop  = start + self.type.nbytes

        if stop > len(bytes):
            msg =  'Decoding %s[%d] requires %d bytes, '
            msg += 'but the ArrayType.decode() method received only %d bytes.'
            raise IndexError(msg % (self.type.name, index, stop, len(bytes)))

        return self.type.decode( bytes[start:stop], raw )
1000268
def readCmd(cls, cmd):
        
        args = shlex.split(cmd)
        proc = subprocess.Popen(args, stdout=subprocess.PIPE)
        (proc_stdout, proc_stderr) = proc.communicate(input=None)  # proc_stdin
        return proc_stdout.decode()