processing table data
964479
private String getTableDataValue( Element tdNode )
    {
        //return tdNode.html();
        StringBuffer buf = new StringBuffer();
        List<Node> childNodes = tdNode.childNodes();
        for ( Node tdChild : childNodes )
        {
            if ( tdChild instanceof TextNode )
            {
                buf.append( ( (TextNode) tdChild ).text() );
            }
            else if ( tdChild instanceof Element )
            {
                Element tdChildElement = (Element) tdChild;
                if ( "br".equals( tdChildElement.tagName() ) )
                {
                    buf.append( "<br />" );
                }
            }
        }
        return buf.toString();
    }
125972
def open_data(self, text, colsep=u"\t", rowsep=u"\n",
                  transpose=False, skiprows=0, comments='#'):
        """"""
        if pd:
            self.pd_text = text
            self.pd_info = dict(sep=colsep, lineterminator=rowsep,
                skiprows=skiprows, comment=comments)
            if colsep is None:
                self.pd_info = dict(lineterminator=rowsep, skiprows=skiprows,
                    comment=comments, delim_whitespace=True)
        self._table_view.process_data(text, colsep, rowsep, transpose,
                                      skiprows, comments)
327626
def to_table_data(self):
        

        self._validate_source_data()
        self._loader.inc_table_count()

        yield TableData(
            self._make_table_name(),
            ["key", "value"],
            [record for record in self._buffer.items()],
            dp_extractor=self._loader.dp_extractor,
            type_hints=self._extract_type_hints(),
        )
264539
def table_output(data):
    ''''''
    if type(data) == DictType:
        data = data.items()
    headings = [ item[0] for item in data ]
    rows = [ item[1] for item in data ]
    columns = zip(*rows)
    if len(columns):
        widths = [ max([ len(str(y)) for y in row ]) for row in rows ]
    else:
        widths = [ 0 for c in headings ]
    for c, heading in enumerate(headings):
        widths[c] = max(widths[c], len(heading))
    column_count = range(len(rows))
    table = [ ' '.join([ headings[c].ljust(widths[c]) for c in column_count ]) ]
    table.append(' '.join([ '=' * widths[c] for c in column_count ]))
    for column in columns:
        table.append(' '.join([ str(column[c]).ljust(widths[c]) for c in column_count ]))
    return '\n'.join(table)
633863
def _process(self, data):
        
        indices = []
        for indexname, indexdata in list(data.items()):
            idata = []
            for docname, docdata in list(indexdata.get("mappings", {}).items()):
                o = get_field(docname, docdata, document_object_field=self.document_object_field, is_document=True)
                o.connection = self.connection
                o.index_name = indexname
                idata.append((docname, o))
            idata.sort()
            indices.append((indexname, idata))
        indices.sort()
        self.indices = OrderedDict(indices)
554169
def _process_data(self, obj):
        """"""
        assert len(self._waiters) > 0, (type(obj), obj)
        waiter, encoding, cb = self._waiters.popleft()
        if isinstance(obj, RedisError):
            if isinstance(obj, ReplyError):
                if obj.args[0].startswith('READONLY'):
                    obj = ReadOnlyError(obj.args[0])
            _set_exception(waiter, obj)
            if self._in_transaction is not None:
                self._transaction_error = obj
        else:
            if encoding is not None:
                try:
                    obj = decode(obj, encoding)
                except Exception as exc:
                    _set_exception(waiter, exc)
                    return
            if cb is not None:
                try:
                    obj = cb(obj)
                except Exception as exc:
                    _set_exception(waiter, exc)
                    return
            _set_result(waiter, obj)
            if self._in_transaction is not None:
                self._in_transaction.append((encoding, cb))
859798
protected function processTableSeeds()
    {
        foreach ($this->getSeedQueries() as $index => $query) {
            
            if (isset($query['iterate'])) {
                for ($x = 1; $x <= $query['iterate']; $x++) {
                    $this->db->insert($query['table'], $query['record']);
                }
                continue;
            }

            $this->db->insert($query['table'], $query['record']);
        }
    }
611353
def process(self):
        
        # Short cut
        if self._all_expressions_evaluated():
            if self.drop:
                # Drop extra columns. They do not correspond to
                # any expressions.
                columns = [expr.column for expr in self.expressions]
                self.data = self.data.loc[:, columns]
            return self.data

        # group_by
        # evaluate expressions
        # combine columns
        # concat evalutated group data and clean up index and group
        gdfs = self._get_group_dataframes()
        egdfs = self._evaluate_expressions(gdfs)
        edata = self._concat(egdfs)
        return edata
368793
def _process(self, data):
        ""
        parts = data.split(':')
        if self._debug:
            self.error('packet: %r' % data)
        if not parts:
            return

        # interpret the packet and update stats
        stats = self._stats
        key = parts[0].translate(KEY_TABLE, KEY_DELETIONS)
        if self._key_prefix:
            key = '.'.join([self._key_prefix, key])
        for part in parts[1:]:
            srate = 1.0
            fields = part.split('|')
            length = len(fields)
            if length < 2:
                continue
            value = fields[0]
            stype = fields[1].strip()

            with stats_lock:
                # timer (milliseconds)
                if stype == 'ms':
                    stats.timers[key].append(float(value if value else 0))

                # counter with optional sample rate
                elif stype == 'c':
                    if length == 3 and fields[2].startswith('@'):
                        srate = float(fields[2][1:])
                    value = float(value if value else 1) * (1 / srate)
                    stats.counts[key] += value
                elif stype == 'g':
                    value = float(value if value else 1)
                    stats.gauges[key] = value
572749
@Override
  protected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
    clinkstep3(id, it, n, pi, lambda, m);
    clinkstep4567(id, ids, it, n, pi, lambda, m);
    clinkstep8(id, it, n, pi, lambda, m);
  }
18916
protected function processRowsHeads() {
        $cols = $this->getCols();
        $this->data = $this->rows;
        if (!empty($cols)) {
            array_unshift($this->data, $cols);
        }
        return $this->data;
    }
81478
def rows(self, table, cols):
        '''
        
        '''
        if self.orng_tables:
            data = []
            for ex in self.orng_tables[table]:
                data.append([ex[str(col)] for col in cols])
            return data
        else:
            return self.fetch(table, cols)
1074787
public void processData() {

        // get number of hands
        float handNum = readbackBuffer.get(0);
        int count = 1;

        boolean rightHandProcessed = false;
        boolean leftHandProcessed = false;

        for (int handCount = 0; handCount < handNum; handCount++) {
            IOHand ioHand;
            HandIODevice device;
            if (handCount == 0) {
                ioHand = rightHand;
                device = rightDevice;
                rightHandProcessed = true;
                GVRSceneObject right = rightHand.getSceneObject();
                if (!right.isEnabled()) {
                    rightHand.getSceneObject().setEnable(true);
                    device.setVisible(true);
                }
            } else {
                ioHand = leftHand;
                device = leftDevice;
                leftHandProcessed = true;
                GVRSceneObject left = leftHand.getSceneObject();
                if (!left.isEnabled()) {
                    leftHand.getSceneObject().setEnable(true);
                    device.setVisible(true);
                }
            }

            //Process Thumbs
            IOFinger ioFinger = ioHand.getIOFinger(IOFinger.THUMB);
            for (int boneNum = 0; boneNum < 4; boneNum++) {
                IOJoint ioJoint = ioFinger.getIOJoint(boneNum + 1);
                if (ioJoint != null) {
                    ioJoint.setPosition(readbackBuffer.get(count), readbackBuffer.get
                            (count + 1), readbackBuffer.get(count + 2));
                }
                count = count + 3;
            }

            setBones(ioFinger);

            if (handCount == 0) {
                // right hand
                for (int fingerNum = 1; fingerNum < 5; fingerNum++) {
                    ioFinger = ioHand.getIOFinger(fingerNum);
                    for (int boneNum = 0; boneNum < 4; boneNum++) {
                        IOJoint ioJoint = ioFinger.getIOJoint(boneNum + 1);
                        if (ioJoint != null) {
                            ioJoint.setPosition(readbackBuffer.get(count), readbackBuffer.get
                                    (count + 1), readbackBuffer.get(count + 2));
                        }
                        count = count + 3;
                    }
                    setBones(ioFinger);
                }
            } else {
                // left hand
                for (int fingerNum = 4; fingerNum > 0; fingerNum--) {
                    ioFinger = ioHand.getIOFinger(fingerNum);
                    for (int boneNum = 0; boneNum < 4; boneNum++) {
                        IOJoint ioJoint = ioFinger.getIOJoint(boneNum + 1);
                        if (ioJoint != null) {
                            ioJoint.setPosition(readbackBuffer.get(count), readbackBuffer.get
                                    (count + 1), readbackBuffer.get(count + 2));
                        }
                        count = count + 3;
                    }
                    setBones(ioFinger);
                }
            }

            //get palm position
            ioHand.getPalmSceneObject().getTransform().setPosition(readbackBuffer.get(count),
                    readbackBuffer.get(count + 1), readbackBuffer.get(count + 2));
            count = count + 3;
            cursorRotation.identity();
            device.process(ioHand.getIOFinger(IOFinger.INDEX).getIOJoint(IOJoint.TIP).getPosition(),
                    cursorRotation);
        }

        if (!rightHandProcessed) {
            GVRSceneObject right = rightHand.getSceneObject();
            if (right.isEnabled()) {
                rightHand.getSceneObject().setEnable(false);
            }
            rightDevice.setVisible(false);
        }
        if (!leftHandProcessed) {
            GVRSceneObject left = leftHand.getSceneObject();
            if (left.isEnabled()) {
                leftHand.getSceneObject().setEnable(false);
            }
            leftDevice.setVisible(false);
        }
    }
621030
def process_data(self, block):
        """"""
        if hasattr(block, 'send_destinations') and block.send_destinations:
            self.fire(events.FileProcessed(block))
            self._log_in_db(block)
            if self._sent_log_file:
                self._log_in_sent_log(block)
            self.log.info("Sent to '%s' file '%s' containing files: %s",
                          str(block.send_destinations),
                          block.processed_data_file_info.basename,
                          str([file_info.path for file_info in block.content_file_infos]))
        else:
            self.log.info("File %s wasn't sent", block.processed_data_file_info.basename)
        return block
545763
function processRowBuffer()
  {
    // get the row to add to the read queue
    var row = rowBuffer[rowIndex++];

    // if we just read the last row in the row buffer, clear the row buffer and
    // reset the row index so that we load the next chunk in the result stream
    // when _read() is called
    if (rowIndex === rowBuffer.length)
    {
      rowBuffer = null;
      rowIndex = 0;
    }

    // initialize the columns and column-related maps if necessary
    if (!columns)
    {
      columns = statement.getColumns();
    }
    if (!mapColumnIdToExtractFnName)
    {
      mapColumnIdToExtractFnName =
          buildMapColumnExtractFnNames(columns, fetchAsString);
    }

    // add the next row to the read queue
    process.nextTick(function()
    {
      self.push(externalizeRow(row, columns, mapColumnIdToExtractFnName));
    });
  }
306810
function ()
    {
        var tableData = [
            ['LOOP TYPE', ...config.counts]
        ];

        var bases = [];
        Object.keys(results['while desc']).forEach(function (countType)
        {
            var times = results['while desc'][countType];
            var sum = times.reduce(function (acc, val)
            {
                return acc + val;
            }, 0);
            bases.push(sum);
        });

        Object.keys(results).forEach(function (loopType)
        {
            var currentResult = [loopType];
            Object.keys(results[loopType]).forEach(function (countType, idx)
            {
                var times = results[loopType][countType];
                var sum = times.reduce(function (acc, val)
                {
                    return acc + val;
                }, 0);

                var relative = '-';
                if (bases[idx] > sum) relative = '-' + String((bases[idx] / sum).toFixed(2)) + '%';
                else if (bases[idx] < sum) relative = '+' + String((bases[idx] / sum).toFixed(2)) + '%';

                currentResult.push(relative);
            });
            tableData.push(currentResult);
        });

        console.log('\n\n' + table(tableData) + '\n');
        process.exit();
    }
1215113
def process_tables(key, value, fmt, meta):
    """"""

    global has_unnumbered_tables  # pylint: disable=global-statement

    # Process block-level Table elements
    if key == 'Table':

        # Inspect the table
        if len(value) == 5:  # Unattributed, bail out
            has_unnumbered_tables = True
            if fmt in ['latex']:
                return [RawBlock('tex', r'\begin{no-prefix-table-caption}'),
                        Table(*value),
                        RawBlock('tex', r'\end{no-prefix-table-caption}')]
            return None

        # Process the table
        table = _process_table(value, fmt)

        # Context-dependent output
        attrs = table['attrs']
        if table['is_unnumbered']:
            if fmt in ['latex']:
                return [RawBlock('tex', r'\begin{no-prefix-table-caption}'),
                        AttrTable(*value),
                        RawBlock('tex', r'\end{no-prefix-table-caption}')]

        elif fmt in ['latex']:
            if table['is_tagged']:  # Code in the tags
                tex = '\n'.join([r'\let\oldthetable=\thetable',
                                 r'\renewcommand\thetable{%s}'%\
                                 references[attrs[0]]])
                pre = RawBlock('tex', tex)
                tex = '\n'.join([r'\let\thetable=\oldthetable',
                                 r'\addtocounter{table}{-1}'])
                post = RawBlock('tex', tex)
                return [pre, AttrTable(*value), post]
        elif table['is_unreferenceable']:
            attrs[0] = ''  # The label isn't needed any further
        elif fmt in ('html', 'html5') and LABEL_PATTERN.match(attrs[0]):
            # Insert anchor
            anchor = RawBlock('html', '<a name="%s"></a>'%attrs[0])
            return [anchor, AttrTable(*value)]
        elif fmt == 'docx':
            # As per http://officeopenxml.com/WPhyperlink.php
            bookmarkstart = \
              RawBlock('openxml',
                       '<w:bookmarkStart w:id="0" w:name="%s"/>'
                       %attrs[0])
            bookmarkend = \
              RawBlock('openxml', '<w:bookmarkEnd w:id="0"/>')
            return [bookmarkstart, AttrTable(*value), bookmarkend]

    return None