Gets a cell value as String and process the value with the given cellProcessors
488657
static String toValue(Cell cell, List<CellProcessor> cellProcessors) {
    String value;
    switch (cell.getCellTypeEnum()) {
      case BLANK:
        value = null;
        break;
      case STRING:
        value = cell.getStringCellValue();
        break;
      case NUMERIC:
        if (DateUtil.isCellDateFormatted(cell)) {
          try {
            // Excel dates are LocalDateTime, stored without timezone.
            // Interpret them as UTC to prevent ambiguous DST overlaps which happen in other
            // timezones.
            LocaleUtil.setUserTimeZone(LocaleUtil.TIMEZONE_UTC);
            Date dateCellValue = cell.getDateCellValue();
            value = formatUTCDateAsLocalDateTime(dateCellValue);
          } finally {
            LocaleUtil.resetUserTimeZone();
          }
        } else {
          // excel stores integer values as double values
          // read an integer if the double value equals the
          // integer value
          double x = cell.getNumericCellValue();
          if (x == Math.rint(x) && !Double.isNaN(x) && !Double.isInfinite(x))
            value = String.valueOf((long) x);
          else value = String.valueOf(x);
        }
        break;
      case BOOLEAN:
        value = String.valueOf(cell.getBooleanCellValue());
        break;
      case FORMULA:
        // evaluate formula
        FormulaEvaluator evaluator =
            cell.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
        CellValue cellValue;
        try {
          cellValue = evaluator.evaluate(cell);
        } catch (StackOverflowError e) {
          LOG.error("StackOverflowError evaluating formula", e);
          throw new RuntimeException(
              "Error evaluating formula, possibly due to deep formula nesting.");
        }
        switch (cellValue.getCellTypeEnum()) {
          case BOOLEAN:
            value = String.valueOf(cellValue.getBooleanValue());
            break;
          case NUMERIC:
            if (DateUtil.isCellDateFormatted(cell)) {
              try {
                // Excel dates are LocalDateTime, stored without timezone.
                // Interpret them as UTC to prevent ambiguous DST overlaps which happen in other
                // timezones.
                LocaleUtil.setUserTimeZone(LocaleUtil.TIMEZONE_UTC);
                Date javaDate = DateUtil.getJavaDate(cellValue.getNumberValue(), false);
                value = formatUTCDateAsLocalDateTime(javaDate);

              } finally {
                LocaleUtil.resetUserTimeZone();
              }
            } else {
              // excel stores integer values as double values
              // read an integer if the double value equals the
              // integer value
              double x = cellValue.getNumberValue();
              if (x == Math.rint(x) && !Double.isNaN(x) && !Double.isInfinite(x))
                value = String.valueOf((long) x);
              else value = String.valueOf(x);
            }
            break;
          case STRING:
            value = cellValue.getStringValue();
            break;
          case BLANK:
            value = null;
            break;
          default:
            throw new MolgenisDataException(
                "unsupported cell type: " + cellValue.getCellTypeEnum());
        }
        break;
      default:
        throw new MolgenisDataException("unsupported cell type: " + cell.getCellTypeEnum());
    }

    return AbstractCellProcessor.processCell(value, false, cellProcessors);
  }
597308
private void processData(final ResultSet rs,
                             List<DataListener> listeners) {

        try {
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();

            int i = 0;

            while (rs.next()) {
                newRow(listeners, i, colCount);
                for (int cellNum = 1; cellNum < colCount + 1; cellNum++) {
                    String cell;

                    int sqlType = rsmd.getColumnType(cellNum);
                    switch (sqlType) {
                        case java.sql.Types.DATE:
                            cell = rs.getDate(cellNum).toString();
                            break;
                        case java.sql.Types.INTEGER:
                        case java.sql.Types.DOUBLE:
                            cell = String.valueOf(rs.getInt(cellNum));
                            break;
                        default:
                            cell = rs.getString(cellNum);
                    }

                    newCell(listeners,
                            i,
                            cellNum - 1,
                            cell,
                            DataListener.NON_MERGED);
                }
                i++;
            }

        } catch (SQLException e) {
            //TODO: you need to throw or handle
        }

        finishData(listeners);
    }
995566
public void parseText(String text, AhoCorasickDoubleArrayTrie.IHit<V> processor)
    {
        int length = text.length();
        int begin = 0;
        BaseNode<V> state = this;

        for (int i = begin; i < length; ++i)
        {
            state = state.transition(text.charAt(i));
            if (state != null)
            {
                V value = state.getValue();
                if (value != null)
                {
                    processor.hit(begin, i + 1, value);
                }
            }
            else
            {
                i = begin;
                ++begin;
                state = this;
            }
        }
    }
269117
private CellFormatResult getErrorCellValue(final byte errorValue, final Locale locale) {

       final FormulaError error = FormulaError.forInt(errorValue);
       final CellFormatResult result = new CellFormatResult();
       result.setCellType(FormatCellType.Error);
       result.setValue(error.getCode());

       if(isErrorCellAsEmpty()) {
           result.setText("");
       } else {
           result.setText(error.getString());
       }

       return result;

    }
936118
public void interpolateColorValue( ByteBuffer cmapBuffer, float cell ) {
        cmapBuffer.put(Float.isNaN(cell) ? blank : getColor(cell));
    }
499264
public void interpolateColorValue( ByteBuffer cmapBuffer, int cell ) {
        cmapBuffer.put(cell == Integer.MAX_VALUE ? blank : getColor((float) cell));
    }
772052
def process_cell(self, row, column, cell):
        
        value, field = self.parse_cell(cell)

        if value or field:
            return {'col':column, 'field':field, 'value':value}
        else:
            return {}
351160
private void processRow(Example valuesRow, Example headers, Fixture rowFixtureAdapter) throws Exception
    {
        Statistics rowStats = new Statistics();

        for (int i = 0; i != valuesRow.remainings(); ++i)
        {
            Example cell = valuesRow.at( i );

            if (i < headers.remainings())
            {
                ExpectedColumn column = columns != null ? (ExpectedColumn) columns[i] :
                        CollectionHeaderForm.parse(headers.at(i).getContent()).selectColumn();
                chekOneCell(rowFixtureAdapter, rowStats, cell, column);
            }
            else
            {
                cell.annotate( ignored( cell.getContent() ) );
            }
        }
        applyRowStatistic(rowStats);
    }
423240
public static ICellValue resolveCellValue(Cell c) {
        if (c == null) { return CellValue.BLANK; }
        
        switch (c.getCellType()) {
            case CELL_TYPE_NUMERIC: { return CellValue.from(c.getNumericCellValue()); }
            case CELL_TYPE_STRING: { return CellValue.from(c.getStringCellValue()); }
            case CELL_TYPE_BOOLEAN: { return CellValue.from(c.getBooleanCellValue()); }
            case CELL_TYPE_ERROR: { return CellValue.from(forInt(c.getErrorCellValue()).getString()); }
            case CELL_TYPE_BLANK: { return CellValue.BLANK; }
            case CELL_TYPE_FORMULA: { return CellValue.from(String.format("%s%s", FORMULA_PREFIX, c.getCellFormula())); }
            default: { throw new CalculationEngineException(String.format("Cell's type %s is not supported.", c.getCellType())); }
        }
    }
642186
protected void executeCellProcessors(final List<Object> destination, final List<?> source,
            final CellProcessor[] processors, final CsvContext context) {
        
        destination.clear();
        
        final SuperCsvRowException rowException = new SuperCsvRowException(
                String.format("row (%d) has errors column", context.getRowNumber()), context);
        for( int i = 0; i < source.size(); i++ ) {
            
            try {
                context.setColumnNumber(i + 1); // update context (columns start at 1)
                
                if( processors[i] == null ) {
                    destination.add(source.get(i)); // no processing required
                } else {
                    destination.add(processors[i].execute(source.get(i), context)); // execute the processor chain
                }
            } catch(SuperCsvCellProcessorException e) {
                rowException.addError(e);
                
                // 各カラムでエラーがあっても、後の入力値検証で処理を続けるために、仮に値を設定する。
                destination.add(source.get(i));
                
            } catch(SuperCsvException e) {
                throw e;
            }
        }
        
        if(rowException.isNotEmptyColumnErrors()) {
            throw rowException;
        }
        
    }
947173
def _cellValue(self, index):
        
        row = index.row()
        col = index.column()
        if (row < 0 or row >= self.rowCount() or col < 0 or col >= self.columnCount()):
            return None

        # The check above should have returned None if the sliced array is None
        assert self._slicedArray is not None, "Sanity check failed."

        nFields = len(self._fieldNames)

        data = self._slicedArray.data
        if self._separateFieldOrientation == Qt.Horizontal:
            dataValue = data[row, col // nFields][self._fieldNames[col % nFields]]
        elif self._separateFieldOrientation == Qt.Vertical:
            dataValue = data[row // nFields, col][self._fieldNames[row % nFields]]
        else:
            dataValue = data[row, col]

        return dataValue
475285
protected String getCellValue(final HtmlRenderingContext context, final int row, final int col,
            final Object value) {
        final String stringValue = LabelUtils.getValueLabel(value);
        return context.escapeHtml(stringValue);
    }
772984
private CellFormatResult getErrorCellValue(final Cell cell, final Locale locale) {

        final CellType cellType = cell.getCellTypeEnum();
        assert cellType == CellType.ERROR;

        return getErrorCellValue(cell.getErrorCellValue(), locale);
    }
659962
@Override
    public Object getValueAt(Object nodeObj, int column) {
        if (debugger == null) { return null; }
        VariableNode node = (VariableNode)nodeObj;
        switch (column) {
        case 0: // Name
            return node.toString();
        case 1: // Value
            String result;
            try {
                result = debugger.objectToString(getValue(node));
            } catch (RuntimeException exc) {
                result = exc.getMessage();
            }
            StringBuilder buf = new StringBuilder();
            int len = result.length();
            for (int i = 0; i < len; i++) {
                char ch = result.charAt(i);
                if (Character.isISOControl(ch)) {
                    ch = ' ';
                }
                buf.append(ch);
            }
            return buf.toString();
        }
        return null;
    }
735859
public static Object getCellValue(int type, Cell cell) {
        switch (type) {
            case Cell.CELL_TYPE_BOOLEAN:
                return cell.getBooleanCellValue();
            case Cell.CELL_TYPE_NUMERIC:
                if (DateUtil.isCellDateFormatted(cell)) {
                    return DateUtil.getJavaDate(cell.getNumericCellValue());
                } else {
                    BigDecimal bd = new BigDecimal(cell.getNumericCellValue());
                    return bd.toString().contains(".") ? bd.setScale(2, RoundingMode.HALF_UP).toString() :
                            bd.toString();
                }
            case Cell.CELL_TYPE_STRING:
                try {
                    return DateUtils.parseDate(cell.getStringCellValue(), ReadExcelUtils.PATTERN);
                } catch (Exception e) {
                    return cell.getStringCellValue();
                }
            case Cell.CELL_TYPE_FORMULA:
                if (DateUtil.isCellDateFormatted(cell)) {
                    return cell.getDateCellValue();
                }
                break;
            default:
                break;
        }
        return null;
    }
1081701
function processBlocks(textString, options, data) {

	var replacer = function replacer(match, $1, $2, $3, $4, $5, $6, offset, input) {
		var out = '',
			dataValue,
			type = String($2),
			key = String($3 || '').trim(),
			blockText = String($5),
			nestedBlocks;

		dataValue = _extract(key, data);

		if (options && typeof options === 'object' && options.strictKeys) {
			if(Number.isNaN(dataValue)) {
				return match;
			}
		}

		nestedBlocks = blockText.match(pattern);
		if (nestedBlocks) {
			blockText = blockText.replace(pattern, function(match, $1, $2, $3, $4, $5, $6, offset, input) {
				var index = match.indexOf($5);
				var length = $5.length;
				var body = $5.replace(/(?:\\*)\[(.+?)(?:\\*)\]/g, "\\[$1]");
				return match.substr(0, index) + body + match.substr(index + length);
			});
		}

		var obj = {}, proto = {}, KEY;
		if (typeof dataValue === 'object' && type === '#') {
			for(KEY in dataValue) {
				obj = {}, proto = {};
				proto.KEY = proto.INDEX = KEY;
				obj[KEY] = proto.VALUE = dataValue[KEY];
				obj.__proto__ = proto;
				if (typeof dataValue[KEY] === 'object' && !isNaN(parseInt(KEY))) {
					obj = dataValue[KEY];
					obj.__proto__ = proto;
				}
				out += renderData(blockText, options, obj, Boolean(options.prefix));
			}
			if (nestedBlocks) {
				out = processBlocks(out, options, data);
			}
		} else if (dataValue && (type === '~' || type === '#')) {
			// block logical truthy
			proto.KEY = proto.INDEX = key;
			proto.VALUE = Boolean(dataValue);
			obj = data;
			obj.__proto__ = proto;

			out += renderData(blockText, options, obj, Boolean(options.prefix));
			if (nestedBlocks) {
				out = processBlocks(out, options, data);
			}
		} else if (!dataValue && (type === '^' || type === '!')) {
			// block logical falsy
			proto.KEY = proto.INDEX = key;
			proto.VALUE = Boolean(dataValue);
			obj = data;
			obj.__proto__ = proto;

			out += renderData(blockText, options, obj, Boolean(options.prefix));
			if (nestedBlocks) {
				out = processBlocks(out, options, data);
			}
		}
		return out;
	};

	var pattern = new RegExp('(\\[\\s*(~|\\^|\\!|#)([^\\r\\n]+)\\s*\\])([\\s]?)([\\s\\S]*?)(\\[\\s*\\/\\3\\s*\\]\\4?)', 'mg');

	if(typeof data === 'object' && data !== null) {
		if (options && typeof options === 'object' && options.prefix) {
			pattern = new RegExp('(\\[\\s*(~|\\^|\\!|#)'+rxquote(String(options.prefix))+'[\\.\\-\\_]([^\\r\\n]+)\\s*\\])(\\s?)([\\s\\S]*?)(\\[\\s*\\/'+rxquote(String(options.prefix))+'[\\.\\-\\_]\\3\\s*\\]\\4?)', 'mg');
		}
		textString = textString.replace(pattern, replacer);
	}

	return textString;
}
727290
def run_cell(self, cell):
        """"""
        logging.info('Running cell:\n%s\n', cell.input)
        self.kc.execute(cell.input)
        reply = self.kc.get_shell_msg()
        status = reply['content']['status']
        traceback_text = ''
        if status == 'error':
            traceback_text = 'Cell raised uncaught exception: \n' + \
                '\n'.join(reply['content']['traceback'])
            logging.info(traceback_text)
        else:
            logging.info('Cell returned')

        outs = list()
        while True:
            try:
                msg = self.kc.get_iopub_msg(timeout=1)
                if msg['msg_type'] == 'status':
                    if msg['content']['execution_state'] == 'idle':
                        break
            except Empty:
                # execution state should return to idle
                # before the queue becomes empty,
                # if it doesn't, something bad has happened
                raise

            content = msg['content']
            msg_type = msg['msg_type']

            # IPython 3.0.0-dev writes pyerr/pyout in the notebook format
            # but uses error/execute_result in the message spec. This does the
            # translation needed for tests to pass with IPython 3.0.0-dev
            notebook3_format_conversions = {
                'error': 'pyerr',
                'execute_result': 'pyout'
            }
            msg_type = notebook3_format_conversions.get(msg_type, msg_type)

            out = NotebookNode(output_type=msg_type)

            if 'execution_count' in content:
                cell['prompt_number'] = content['execution_count']
                out.prompt_number = content['execution_count']

            if msg_type in ('status', 'pyin', 'execute_input'):
                continue
            elif msg_type == 'stream':
                out.stream = content['name']
                # in msgspec 5, this is name, text
                # in msgspec 4, this is name, data
                if 'text' in content:
                    out.text = content['text']
                else:
                    out.text = content['data']
            elif msg_type in ('display_data', 'pyout'):
                for mime, data in content['data'].items():
                    try:
                        attr = self.MIME_MAP[mime]
                    except KeyError:
                        raise NotImplementedError(
                            'unhandled mime type: %s' % mime
                        )

                    # In notebook version <= 3 JSON data is stored as a string
                    # Evaluation of IPython2's JSON gives strings directly
                    # Therefore do not encode for IPython versions prior to 3
                    json_encode = (
                            IPython.version_info[0] >= 3 and
                            mime == "application/json")

                    data_out = data if not json_encode else json.dumps(data)
                    setattr(out, attr, data_out)
            elif msg_type == 'pyerr':
                out.ename = content['ename']
                out.evalue = content['evalue']
                out.traceback = content['traceback']
            elif msg_type == 'clear_output':
                outs = list()
                continue
            else:
                raise NotImplementedError(
                    'unhandled iopub message: %s' % msg_type
                )
            outs.append(out)
        cell['outputs'] = outs

        if status == 'error':
            raise NotebookError(traceback_text)