Default raw input report data handler
438957
def _process_raw_report(self, raw_report):
        ""
        if not self.is_opened():
            return
        if not self.__evt_handlers and not self.__raw_handler:
            return

        if not raw_report[0]  and \
                (raw_report[0] not in self.__input_report_templates):
            # windows sends an empty array when disconnecting
            # but, this might have a collision with report_id = 0
            if not hid_device_path_exists(self.device_path):
                #windows XP sends empty report when disconnecting
                self.__reading_thread.abort() #device disconnected
            return

        if self.__raw_handler:
            #this might slow down data throughput, but at the expense of safety
            self.__raw_handler(helpers.ReadOnlyList(raw_report))
            return

        # using pre-parsed report templates, by report id
        report_template = self.__input_report_templates[raw_report[0]]
        # old condition snapshot
        old_values = report_template.get_usages()
        # parse incoming data
        report_template.set_raw_data(raw_report)
        # and compare it
        event_applies = self.evt_decision
        evt_handlers  = self.__evt_handlers
        for key in report_template.keys():
            if key not in evt_handlers:
                continue
            #check if event handler exist!
            for event_kind, handlers in evt_handlers[key].items():
                #key=event_kind, values=handler set
                new_value = report_template[key].value
                if not event_applies[event_kind](old_values[key], new_value):
                    continue
                #decision applies, call handlers
                for function_handler in handlers:
                    #check if the application wants some particular parameter
                    if handlers[function_handler]:
                        function_handler(new_value,
                                event_kind, handlers[function_handler])
                    else:
                        function_handler(new_value, event_kind)
984628
def data_raw(self):
    """"""
    return self._client.send(data=sc_pb.RequestData(
        ability_id=True, unit_type_id=True))
976543
def edit_inputs(client, workflow):
    """"""
    types = {
        'int': int,
        'string': str,
        'File': lambda x: File(path=Path(x).resolve()),
    }
    for input_ in workflow.inputs:
        convert = types.get(input_.type, str)
        input_.default = convert(
            click.prompt(
                '{0.id} ({0.type})'.format(input_),
                default=_format_default(client, input_.default),
            )
        )
    return workflow
565656
def _handle_dump_unknown(self, data, original):
        """"""
        for key, val in original.items():
            if key not in self.fields:
                data[key] = val
        return data
272703
def standard_input():
    """"""
    with click.get_text_stream("stdin") as stdin:
        while stdin.readable():
            line = stdin.readline()
            if line:
                yield line.strip().encode("utf-8")
414818
function(raw_tag, widget_config) {

		if (Lava.schema.DEBUG && (!raw_tag.content || !raw_tag.content.length)) Lava.t('default_events: no content.');
		if (Lava.schema.DEBUG && ('default_events' in widget_config)) Lava.t('default_events: property already defined');

		var events = Lava.parseOptions(raw_tag.content[0]),
			i = 0,
			count;

		if (Lava.schema.DEBUG) {
			if (!Array.isArray(events)) Lava.t('default_events: array expected');
			for (count = events.length; i < count; i++) {
				if (typeof(events[i]) != 'string') Lava.t('default_events: expected an array of strings');
			}
		}

		widget_config.default_events = Lava.excludeDefaultEvents(events);

	}
1251750
function parseRequestData($rawInput = NULL)
    {
        try {

            if ($rawInput == NULL)
                throw new Exception ("Input must be defined", 503);

            $result = array();

            if (is_string($rawInput))
                $result = json_decode($rawInput, TRUE);

            if (is_array($rawInput))
                $result = $rawInput;

            if (is_object($rawInput))
                $result = json_decode(json_encode($rawInput), TRUE);

            return $result;

        } catch (Exception $e) {
            die("Exception raised: " . $e->getMessage() . "\nFile: " . $e->getFile() . "\nLine: " . $e->getLine());
        }
    }
694296
function processData(res, data, options) {
  const handlers = Object.assign({}, deserializers, options.deserializers);
  const contentType = res.headers['content-type'];
  const types = typeof contentType === 'string' ? contentType.split(';') : [];

  // if there are no content types, return the data unmodified
  if (!types.length) {
    return data;
  }

  return types.reduce((d, type) => {
    try {
      const t = type.toLocaleLowerCase().trim();
      const handler = handlers[t];

      if (d instanceof Error || typeof handler !== 'function') {
        return d;
      }
      return handler(d);
    } catch (error) {
      return error;
    }
  }, data);
}
637072
function htmlParserImpl(html, handler) {
    if (html === null || html === undefined) {
      html = '';
    } else if (typeof html !== 'string') {
      html = '' + html;
    }
    inertBodyElement.innerHTML = html;

    //mXSS protection
    var mXSSAttempts = 5;
    do {
      if (mXSSAttempts === 0) {
        throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable');
      }
      mXSSAttempts--;

      // strip custom-namespaced attributes on IE<=11
      if (window.document.documentMode) {
        stripCustomNsAttrs(inertBodyElement);
      }
      html = inertBodyElement.innerHTML; //trigger mXSS
      inertBodyElement.innerHTML = html;
    } while (html !== inertBodyElement.innerHTML);

    var node = inertBodyElement.firstChild;
    while (node) {
      switch (node.nodeType) {
        case 1: // ELEMENT_NODE
          handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));
          break;
        case 3: // TEXT NODE
          handler.chars(node.textContent);
          break;
      }

      var nextNode;
      if (!(nextNode = node.firstChild)) {
        if (node.nodeType === 1) {
          handler.end(node.nodeName.toLowerCase());
        }
        nextNode = node.nextSibling;
        if (!nextNode) {
          while (nextNode == null) {
            node = node.parentNode;
            if (node === inertBodyElement) break;
            nextNode = node.nextSibling;
            if (node.nodeType === 1) {
              handler.end(node.nodeName.toLowerCase());
            }
          }
        }
      }
      node = nextNode;
    }

    while ((node = inertBodyElement.firstChild)) {
      inertBodyElement.removeChild(node);
    }
  }
535512
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data["properties"]

        raw_content = properties.get("accessControlList", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["accessControlList"] = resource

        # TODO(alexcoman): Add model for ServiceInsertion
        raw_content = properties.get("serviceInsertion", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["serviceInsertion"] = resource

        raw_content = properties.get("routeTable", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["routeTable"] = resource

        ip_configurations = []
        for raw_config in properties.get("ipConfigurations", []):
            ip_configurations.append(Resource.from_raw_data(raw_config))
        properties["ipConfigurations"] = ip_configurations

        return super(SubNetworks, cls).process_raw_data(raw_data)
630064
public void addAttribute(String rawName, String value)
    {
        if (m_firstTagNotEmitted)
        {
            flush();
        }
        m_handler.addAttribute(rawName, value);
 
    }
306840
def show_inputs(client, workflow):
    """"""
    for input_ in workflow.inputs:
        click.echo(
            '{id}: {default}'.format(
                id=input_.id,
                default=_format_default(client, input_.default),
            )
        )
    sys.exit(0)
180677
private void handleDecodeExternally(Result rawResult, Bitmap barcode) {

    if (barcode != null) {
      viewfinderView.drawResultBitmap(barcode);
    }

    long resultDurationMS = CaptureActivityIntents.getResultDisplayDurationInMsOrDefaultValue(getIntent());
    if (resultDurationMS > 0) {
      String rawResultString = String.valueOf(rawResult);
      if (rawResultString.length() > 32) {
        rawResultString = rawResultString.substring(0, 32) + " ...";
      }
      statusView.setText(rawResultString);
    }
      
      // Hand back whatever action they requested - this can be changed to Intents.Scan.ACTION when
      // the deprecated intent is retired.
      Intent intent = new Intent(getIntent().getAction());
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
      intent.putExtra(Intents.Scan.RESULT, rawResult.toString());
      intent.putExtra(Intents.Scan.RESULT_FORMAT, rawResult.getBarcodeFormat().toString());
      byte[] rawBytes = rawResult.getRawBytes();
      if (rawBytes != null && rawBytes.length > 0) {
        intent.putExtra(Intents.Scan.RESULT_BYTES, rawBytes);
      }
      Map<ResultMetadataType,?> metadata = rawResult.getResultMetadata();
      if (metadata != null) {
        if (metadata.containsKey(ResultMetadataType.UPC_EAN_EXTENSION)) {
          intent.putExtra(Intents.Scan.RESULT_UPC_EAN_EXTENSION,
                          metadata.get(ResultMetadataType.UPC_EAN_EXTENSION).toString());
        }
        Number orientation = (Number) metadata.get(ResultMetadataType.ORIENTATION);
        if (orientation != null) {
          intent.putExtra(Intents.Scan.RESULT_ORIENTATION, orientation.intValue());
        }
        String ecLevel = (String) metadata.get(ResultMetadataType.ERROR_CORRECTION_LEVEL);
        if (ecLevel != null) {
          intent.putExtra(Intents.Scan.RESULT_ERROR_CORRECTION_LEVEL, ecLevel);
        }
        @SuppressWarnings("unchecked")
        Iterable<byte[]> byteSegments = (Iterable<byte[]>) metadata.get(ResultMetadataType.BYTE_SEGMENTS);
        if (byteSegments != null) {
          int i = 0;
          for (byte[] byteSegment : byteSegments) {
            intent.putExtra(Intents.Scan.RESULT_BYTE_SEGMENTS_PREFIX + i, byteSegment);
            i++;
          }
        }
      }
      sendReplyMessage(R.id.return_scan_result, intent, resultDurationMS);

  }
321720
def _handle_dump(self, handler, file_object, **kwargs):
    

    return handler.dump(self.__class__, to_dict(self), file_object, **kwargs)
76803
def _handle_input_request(self, msg):
        """"""
        if self._hidden:
            raise RuntimeError('Request for raw input during hidden execution.')

        # Make sure that all output from the SUB channel has been processed
        # before entering readline mode.
        self.kernel_client.iopub_channel.flush()

        def callback(line):
            # Save history to browse it later
            if not (len(self._control.history) > 0
                    and self._control.history[-1] == line):
                # do not save pdb commands
                cmd = line.split(" ")[0]
                if "do_" + cmd not in dir(pdb.Pdb):
                    self._control.history.append(line)

            # This is the Spyder addition: add a %plot magic to display
            # plots while debugging
            if line.startswith('%plot '):
                line = line.split()[-1]
                code = "__spy_code__ = get_ipython().run_cell('%s')" % line
                self.kernel_client.input(code)
            else:
                self.kernel_client.input(line)
        if self._reading:
            self._reading = False
        self._readline(msg['content']['prompt'], callback=callback,
                       password=msg['content']['password'])
1284981
def process_raw_data(cls, raw_data):
        """"""

        # pylint: disable=redefined-variable-type

        raw_content = raw_data.get("updateMessageStats", None)
        if raw_content is not None:
            statistics = UpdateMessageStatistics.from_raw_data(raw_content)
            raw_data["updateMessageStats"] = statistics

        raw_content = raw_data.get("routeRefreshMessageStats", None)
        if raw_content is not None:
            statistics = RouteRefreshMessageStatistics.from_raw_data(
                raw_content)
            raw_data["routeRefreshMessageStats"] = statistics

        raw_content = raw_data.get("keepAliveMessageStats", None)
        if raw_content is not None:
            statistics = KeepAliveMessageStatistics.from_raw_data(raw_content)
            raw_data["keepAliveMessageStats"] = statistics

        raw_content = raw_data.get("notificationMessageStats", None)
        if raw_content is not None:
            statistics = NotificationMessageStatistics.from_raw_data(
                raw_content)
            raw_data["notificationMessageStats"] = statistics

        raw_content = raw_data.get("openMessageStats", None)
        if raw_content is not None:
            statistics = OpenMessageStatistics.from_raw_data(raw_content)
            raw_data["openMessageStats"] = statistics

        raw_content = raw_data.get("ipv4Route", None)
        if raw_content is not None:
            statistics = IPV4Route.from_raw_data(raw_content)
            raw_data["ipv4Route"] = statistics

        raw_content = raw_data.get("ipv6Route", None)
        if raw_content is not None:
            statistics = IPV6Route.from_raw_data(raw_content)
            raw_data["ipv6Route"] = statistics

        return super(BGPPeersStatistics, cls).process_raw_data(raw_data)
793027
function onData(rawData){

        // strip delimiter sequence from array
        const input = rawData.toString(_encoding);

        // response data object - default no response data
        const data = {
            echo: input,
            response: null
        };

        // response found ? split echo and response
        const splitIndex = input.indexOf('\n');
        if (splitIndex > 0){
            data.echo = input.substr(0, splitIndex).trim();
            data.response = input.substr(splitIndex + 1).trim();
        }

        // process waiting for input ?
        if (_waitingForInput !== null){
            const resolver = _waitingForInput;
            _waitingForInput = null;
            resolver(data);
        }else{
            _inputbuffer.push(data);
        }
    }