Parses feed generator and sets value
968294
def set_generator(self):
        """"""
        try:
            self.generator = self.soup.find('generator').string
        except AttributeError:
            self.generator = None
641817
def _feed_stream(feeder, in_stream, out_stream, block_size = BLOCK_SIZE):
    ''

    while True:
        chunk = in_stream.read(block_size)
        if not chunk:
            break
        converted = feeder.feed(chunk)
        out_stream.write(converted)
    converted = feeder.feed()
    out_stream.write(converted)
323150
public function feed()
    {
        if (isset($_FILES[$this->getName()])) {
            $this->setValue($_FILES[$this->getName()]);
        } else {
            throw new tao_helpers_form_Exception('cannot evaluate the element ' . __CLASS__);
        }
    }
821508
def set(self, option, value):
		
		self.config_parser.set(self.section_name, option, value)
808091
public static Feed generateFeed(String request, String matcherDetails, Map<URI, MatchResult> matchingResults) {

        Feed feed = initialiseFeed(request, matcherDetails);

        // Return empty feed if null
        if (matchingResults == null) {
            return feed;
        }

        int numResults = matchingResults.size();
        log.debug(matchingResults.keySet().toString());

        Set<Map.Entry<URI, MatchResult>> entries = matchingResults.entrySet();
        for (Map.Entry<URI, MatchResult> entry : entries) {
            Entry rssEntry = createMatchResultEntry(entry.getKey(), entry.getValue());
            feed.addEntry(rssEntry);
        }

        return feed;
    }
205758
def parser_feed(parser, text):
    """"""
    encoded_text = text.encode('utf-8')
    return _cmark.lib.cmark_parser_feed(
        parser, encoded_text, len(encoded_text))
4518
def _feed_line(self, line):
        """"""
        if line is None:
            self.set_result(self._callback(self.__spooled_lines))
        else:
            self.__spooled_lines.append(line)
465995
def parse_output(self, line):
        """"""

        try:
            key, value = line.split(":")
            self.update_value(key.strip(), value.strip())
        except ValueError:
            pass
113991
def set(self, value, parse=False):
        
        self.value = self.parse(value) if parse else value
259530
def feed(self, data):
        
        assert isinstance(data, binary_type)

        self.parser.feed(data)

        # Render again.
        self.cli._redraw()

        # When a return value has been set (enter was pressed), handle command.
        if self.cli.is_returning:
            try:
                return_value = self.cli.return_value()
            except (EOFError, KeyboardInterrupt) as e:
                # Control-D or Control-C was pressed.
                logger.info('%s, closing connection.', type(e).__name__)
                self.close()
                return

            # Handle CLI command
            self._handle_command(return_value)
587148
def iter_parsed_values(self, field: Field) -> Iterable[Tuple[str, Any]]:
        
        for key, func in self.parsers.items():
            value = func(field)
            if not value:
                continue
            yield key, value
1059821
function feed(op, pnode) {
        if (numStreams > 0) {
            changes.push({op:op, pnode:pnode.toJSON()})
        }
    }
361204
def feed_line(self, line):
        
        self.line += 1
        pos = 0
        while pos < len(line):
            loc_start = TextLocationSingle(self.filename, self.line, pos + 1)
            if self.state is State.NORMAL:
                item_re = RE_TOKEN
                thing = 'token'
            elif self.state is State.STRING:
                item_re = RE_STRING_ITEM
                thing = 'escape sequence'
            elif self.state is State.BINARRAY:
                item_re = RE_BINARRAY_ITEM[self.binarray_base]
                thing = 'binarray item'
            else:
                assert 0
            match = item_re.match(line, pos)
            if not match:
                raise ReadError(f'{loc_start}: unknown {thing}')
            pos = match.end()
            loc_end = TextLocationSingle(self.filename, self.line, pos + 1)
            loc = loc_start - loc_end
            if match['ws_error'] is not None:
                raise ReadError(f'{loc_end}: no whitespace after token')
            if self.state is State.NORMAL:
                # Normal state -- read tokens.
                if match['lparen'] is not None:
                    self.stack.append(StackEntryList(loc_start, []))
                elif match['rparen'] is not None:
                    if not self.stack:
                        raise ReadError(f'{loc}: unmatched closing paren')
                    top = self.stack.pop()
                    if not isinstance(top, StackEntryList):
                        top.raise_unclosed_error()
                    yield from self._feed_node(top.items, top.start - loc_end)
                elif match['symbol'] is not None:
                    value = Symbol(match['symbol'])
                    yield from self._feed_node(value, loc)
                elif match['sexpr_comment'] is not None:
                    self.stack.append(StackEntryComment(loc))
                elif match['bool_value'] is not None:
                    value = match['bool_value'] == '@true'
                    yield from self._feed_node(value, loc)
                elif match['nil_value'] is not None:
                    yield from self._feed_node(None, loc)
                elif match['int_or_word'] is not None:
                    if match['number'] is not None:
                        value = int(match['number'], 0)
                    elif match['raw_char'] is not None:
                        value = ord(match['raw_char'])
                    elif match['simple_escape'] is not None:
                        value = ord(ESCAPE_TO_CHAR[match['simple_escape']])
                    elif match['hex_code'] is not None:
                        value = int(match['hex_code'], 16)
                        if value not in range(0x110000):
                            raise ReadError(
                                    f'{loc}: not a valid unicode codepoint')
                    else:
                        assert 0
                    if match['word_width'] is not None:
                        width = int(match['word_width'])
                        if value < 0:
                            value += 1 << width
                        if value not in range(1 << width):
                            raise ReadError(f'{loc}: word value out of range')
                        value = BinWord(width, value)
                    yield from self._feed_node(value, loc)
                elif match['array_width'] is not None:
                    self.binarray_base = {
                        '0b': 2,
                        '0o': 8,
                        None: 10,
                        '0x': 16,
                    }[match['array_base']]
                    self.binarray_data = []
                    self.binarray_width = int(match['array_width'])
                    self.token_start = loc_start
                    self.state = State.BINARRAY
                elif match['start_quote'] is not None:
                    self.state = State.STRING
                    self.token_start = loc_start
                    self.string_buffer = StringIO()
                    if match['string_width'] is not None:
                        self.binarray_width = int(match['string_width'])
                    else:
                        self.binarray_width = None
            elif self.state is State.STRING:
                # Inside a string.
                if match['end_quote'] is not None:
                    self.state = State.NORMAL
                    value = self.string_buffer.getvalue()
                    loc = self.token_start - loc_end
                    if self.binarray_width is not None:
                        vals = [ord(x) for x in value]
                        for x in vals:
                            if x not in range(1 << self.binarray_width):
                                raise ReadError(
                                        f'{loc}: character code out of range')
                        value = BinArray(vals, width=self.binarray_width)
                    yield from self._feed_node(value, loc)
                elif match['raw_chars'] is not None:
                    self.string_buffer.write(match['raw_chars'])
                elif match['simple_escape'] is not None:
                    c = ESCAPE_TO_CHAR[match['simple_escape']]
                    self.string_buffer.write(c)
                elif match['hex_code'] is not None:
                    code = int(match['hex_code'], 16)
                    if code not in range(0x110000):
                        raise ReadError(
                                f'{loc}: not a valid unicode codepoint')
                    self.string_buffer.write(chr(code))
                else:
                    assert 0
            elif self.state is State.BINARRAY:
                # In a BinArray.
                if match['rparen'] is not None:
                    self.state = State.NORMAL
                    value = BinArray(self.binarray_data,
                                     width=self.binarray_width)
                    loc = self.token_start - loc_end
                    yield from self._feed_node(value, loc)
                elif match['digits'] is not None:
                    value = int(match['digits'], self.binarray_base)
                    if value < 0:
                        value += 1 << self.binarray_width
                    if value not in range(1 << self.binarray_width):
                        raise ReadError(f'{loc}: word value out of range')
                    self.binarray_data.append(value)
            else:
                assert 0
370701
public function parse()
    {

        // TODO - Use feed names with alias style like FBL
        // TODO - Use both DATE fields
        // TODO - Try YAML parser?

        $this->feedName = 'default';

        if ($this->isKnownFeed() && $this->isEnabledFeed() && $this->hasArfMail()) {
            // As this is a generic FBL parser we need to see which was the source and add the name
            // to the report, so its origin is clearly shown.
            $source = $this->parsedMail->getHeader('from');
            foreach (config("{$this->configBase}.parser.aliases") as $from => $alias) {
                if (preg_match($from, $source)) {
                    // If there is an alias, prefer that name instead of the from address
                    $source = $alias;

                    // If there is an more specific feed configuration prefer that config over the default
                    if (!empty(config("{$this->configBase}.feeds.{$source}"))) {
                        $this->feedName = $source;
                    }

                }
            }

            if (preg_match_all('/([\w\-]+): (.*)[ ]*\r?\n/', $this->arfMail['report'] . PHP_EOL, $regs)) {
                $report = array_combine($regs[1], $regs[2]);

                if (empty($report['Received-Date'])) {
                    if (!empty($report['Arrival-Date'])) {
                        $report['Received-Date'] = $report['Arrival-Date'];
                        unset($report['Arrival-Date']);
                    }
                }

                if ($this->hasRequiredFields($report) === true) {
                    // incident has all requirements met, filter and add!
                    if ($report['Feedback-Type'] != 'abuse') {
                        return $this->failed(
                            "Unabled to detect the report type from this notifier"
                        );
                    }

                    $report = $this->applyFilters($report);

                    $report['evidence'] = $this->arfMail['evidence'];

                    $incident = new Incident();
                    $incident->source      = $source;
                    $incident->source_id   = false;
                    $incident->ip          = $report['Source-IP'];
                    $incident->domain      = false;
                    $incident->class       = config("{$this->configBase}.feeds.{$this->feedName}.class");
                    $incident->type        = config("{$this->configBase}.feeds.{$this->feedName}.type");
                    $incident->timestamp   = strtotime($report['Received-Date']);
                    $incident->information = json_encode($report);

                    $this->incidents[] = $incident;

                }
            } else {
                $this->warningCount++;
            }
        }

        return $this->success();
    }
614345
def ParseDom(self, dom, feed):
    
    shape_num = 0
    for node in dom.getElementsByTagName('Placemark'):
      p = self.ParsePlacemark(node)
      if p.IsPoint():
        (lon, lat) = p.coordinates[0]
        m = self.stopNameRe.search(p.name)
        feed.AddStop(lat, lon, m.group(1))
      elif p.IsLine():
        self.ConvertPlacemarkToShape(p, feed)
238042
function parseTitle (node, nodeType, feedType) {
  return utils.stripHtml(utils.get(node.title));
}
521388
function parseSource (node, nodeType, feedType) {
  var source = {},
      sourceNode = node.source,
      temp;

  if (!sourceNode) {
    return;
  }

  if (temp = (feedType === 'atom' && utils.get(sourceNode.title)) || utils.get(sourceNode)) {
    source.title = temp;
  }
  if (temp = (feedType === 'atom' && utils.getAttr(sourceNode.link, 'href')) || utils.getAttr(sourceNode, 'url')) {
    source.url = temp;
  }

  return Object.keys(source).length && source;
}