Parse the request command input.

    Input:
       Request Handle

    Output:
       Request Handle updated with parsed input.
       Return code - 0: ok, non-zero: error
919
def parseCmdline(rh):
    

    rh.printSysLog("Enter powerVM.parseCmdline")

    if rh.totalParms >= 2:
        rh.userid = rh.request[1].upper()
    else:
        # Userid is missing.
        msg = msgs.msg['0010'][1] % modId
        rh.printLn("ES", msg)
        rh.updateResults(msgs.msg['0010'][0])
        rh.printSysLog("Exit powerVM.parseCmdLine, rc: " +
            rh.results['overallRC'])
        return rh.results['overallRC']

    if rh.totalParms == 2:
        rh.subfunction = rh.userid
        rh.userid = ''

    if rh.totalParms >= 3:
        rh.subfunction = rh.request[2].upper()

    # Verify the subfunction is valid.
    if rh.subfunction not in subfuncHandler:
        # Subfunction is missing.
        subList = ', '.join(sorted(subfuncHandler.keys()))
        msg = msgs.msg['0011'][1] % (modId, subList)
        rh.printLn("ES", msg)
        rh.updateResults(msgs.msg['0011'][0])

    # Parse the rest of the command line.
    if rh.results['overallRC'] == 0:
        rh.argPos = 3               # Begin Parsing at 4th operand
        generalUtils.parseCmdline(rh, posOpsList, keyOpsList)

    waiting = 0
    if rh.results['overallRC'] == 0:
        if rh.subfunction == 'WAIT':
            waiting = 1
            if rh.parms['desiredState'] not in vmOSUpDownStates:
                # Desired state is not: down, off, on or up.
                msg = msgs.msg['0013'][1] % (modId,
                    rh.parms['desiredState'], ", ".join(vmOSUpDownStates))
                rh.printLn("ES", msg)
                rh.updateResults(msgs.msg['0013'][0])

    if (rh.results['overallRC'] == 0 and 'wait' in rh.parms):
        waiting = 1
        if 'desiredState' not in rh.parms:
            if rh.subfunction in ['ON', 'RESET', 'REBOOT']:
                rh.parms['desiredState'] = 'up'
            else:
                # OFF and SOFTOFF default to 'off'.
                rh.parms['desiredState'] = 'off'

    if rh.results['overallRC'] == 0 and waiting == 1:
        if rh.subfunction == 'ON' or rh.subfunction == 'RESET':
            if ('desiredState' not in rh.parms or
                  rh.parms['desiredState'] not in vmOSUpStates):
                # Desired state is not: on or up.
                msg = msgs.msg['0013'][1] % (modId,
                    rh.parms['desiredState'], ", ".join(vmOSUpStates))
                rh.printLn("ES", msg)
                rh.updateResults(msgs.msg['0013'][0])

        if rh.results['overallRC'] == 0:
            if 'maxWait' not in rh.parms:
                rh.parms['maxWait'] = 300
            if 'poll' not in rh.parms:
                rh.parms['poll'] = 15
            rh.parms['maxQueries'] = (rh.parms['maxWait'] +
                rh.parms['poll'] - 1) / rh.parms['poll']
            # If we had to do some rounding, give a warning
            # out to the command line user that the wait
            # won't be what they expected.
            if rh.parms['maxWait'] % rh.parms['poll'] != 0:
                msg = msgs.msg['0017'][1] % (modId,
                    rh.parms['maxWait'], rh.parms['poll'],
                    rh.parms['maxQueries'] * rh.parms['poll'],
                    rh.parms['maxQueries'])
                rh.printLn("W", msg)

    rh.printSysLog("Exit powerVM.parseCmdLine, rc: " +
        str(rh.results['overallRC']))
    return rh.results['overallRC']
910028
def post_parse(self, uri, params={}, data={}):
        '''
        '''
        return self._request_parse(self.post, uri, params, data)
373224
public static String parse(String commandLine, final CommandLineParser.CallbackHandler handler) throws CommandFormatException {
        return parse(commandLine, handler, true);
    }
715900
def get_handler(self, request):
        
        try:
            f = self._json_rpc_methods[request.method]

        except (AttributeError, KeyError):  # pragma no coverage
            raise RPCMethodError("Received invalid method '{}'".format(request.method))

        return f
158088
def parse(handle):
    

    components = handle.split('/', 1)
    if len(components) == 1:
        return None, components[0]
    elif len(components) == 2:
        return components[0], components[1]
    else:
        raise BinstarError("{} can't be parsed".format(handle))
233781
function parseInput(input) {
  var match = re.exec(input);

  if (match !== null) {
    var _match = _slicedToArray(match, 6),
        pre_keyword = _match[1],
        operator_keyword = _match[2],
        value = _match[3],
        unit = _match[4],
        post_keyword = _match[5];

    if (pre_keyword && post_keyword || pre_keyword && operator_keyword || post_keyword && operator_keyword) {
      return null;
    }

    return {
      value: sanitizeValue({
        value: value,
        operator_keyword: operator_keyword,
        post_keyword: post_keyword
      }),
      unit: unit
    };
  }

  return null;
}
107459
def main(argv: Optional[Sequence[str]] = None) -> None:
    
    args = parse_arguments(argv=argv)

    if args.logging:
        logging.basicConfig(level=logging.DEBUG)

    handle_skip()

    action = args.action
    request = parse_request()
    LOGGER.debug('Received action %s with request:\n%s',
                 action, request)

    try:
        mapping = parse_mapping(args.mapping)
    except Exception as error:
        LOGGER.critical('Unable to parse mapping file', exc_info=True)
        print(  # noqa: P101
            'Unable to parse mapping file: {error}'.format(
                error=error),
            file=sys.stderr)
        sys.exit(1)

    if action == 'get':
        get_password(request, mapping)
    else:
        LOGGER.info('Action %s is currently not supported', action)
        sys.exit(1)
620559
def parse(data):
    

    # convert to string
    data = data.decode("ascii")

    if len(data) == 2 and data == "A5":
        return AckMessage()

    # split into bytes
    raw = [data[i:i+2] for i in range(len(data)) if i % 2 == 0]

    if len(raw) != 7:
        return UnknownMessage(raw)

    if raw[1] == "B8":
        return StateMessage(raw)
    elif raw[3] == "12":
        return CommandMessage(raw)
    elif raw[3] == "14":
        return ScenarioTriggeredMessage(raw)
    elif raw[3] == "15":
        return RequestStatusMessage(raw)
    else:
        return UnknownMessage(raw)
757310
def handle_command(editor, input_string):
    
    # Match with grammar and extract variables.
    m = COMMAND_GRAMMAR.match(input_string)
    if m is None:
        return

    variables = m.variables()
    command = variables.get('command')
    go_to_line = variables.get('go_to_line')
    shell_command = variables.get('shell_command')

    # Call command handler.

    if go_to_line is not None:
        # Handle go-to-line.
        _go_to_line(editor, go_to_line)

    elif shell_command is not None:
        # Handle shell commands.
        editor.application.run_system_command(shell_command)

    elif has_command_handler(command):
        # Handle other 'normal' commands.
        call_command_handler(command, editor, variables)
    else:
        # For unknown commands, show error message.
        editor.show_message('Not an editor command: %s' % input_string)
        return

    # After execution of commands, make sure to update the layout and focus
    # stack.
    editor.sync_with_prompt_toolkit()
96159
def read_request_line(self, request_line):
		

		request = self.__request_cls.parse_request_line(self, request_line)

		protocol_version = self.protocol_version()
		if protocol_version == '0.9':
			if request.method() != 'GET':
				raise Exception('HTTP/0.9 standard violation')
		elif protocol_version == '1.0' or protocol_version == '1.1':
			pass
		elif protocol_version == '2':
			pass
		else:
			raise RuntimeError('Unsupported HTTP-protocol')
341723
def parse_request(self, request, parameters, fake_method=None):
        '''
        
        '''
        return (fake_method or request.method,
                request.build_absolute_uri(),
                request.META,
                (dict(request.POST.iteritems())
                    if request.method == 'POST'
                    else parameters))
886990
def _parse_positive_int_param(request, param_name):
  
  param = request.args.get(param_name)
  if not param:
    return None
  try:
    param = int(param)
    if param <= 0:
      raise ValueError()
    return param
  except ValueError:
    return -1
915270
def command(execute=None):  # noqa: E501
    
    if connexion.request.is_json:
        execute = Execute.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
75423
async def parse_response(self, connection, command_name, **options):
        ""
        response = await connection.read_response()
        if command_name in self.response_callbacks:
            callback = self.response_callbacks[command_name]
            return callback(response, **options)
        return response
1003678
public static String parseOperationRequest(String commandLine, final CommandLineParser.CallbackHandler handler) throws CommandFormatException {
        SubstitutedLine sl = parseOperationRequestLine(commandLine, handler, null);
        return sl == null ? null : sl.getSubstitued();
    }
918173
function parseCommand(data) {
  var command,
      str = data.toString('utf8', 0, data.length);

  command = str.split('\n');
  return command[0];
}
640731
def request(self, *args, **kwargs):
        
        r = self.session.request(*args, **kwargs)
        if r.status_code != requests.codes.ok:
            error = ET.fromstring(r.content)
            message = error.findtext('message')
            code = error.attrib['key']
            raise CleanwebError('%s (%s)' % (message, code))
        return r