tickString(EWrapper self, TickerId tickerId, TickType tickType, IBString const & value)
547050
def tickString(self, tickerId, tickType, value):
        """"""
        return _swigibpy.EWrapper_tickString(self, tickerId, tickType, value)
500022
private <T> void writeNameOrValue(TypedParser<T> helper, T val)
            throws TException {
        getCurrentContext().write();
        try {
            if (getCurrentContext().isMapKey()) {
                getCurrentWriter().writeFieldName(val.toString());
            } else {
                helper.writeValue(getCurrentWriter(), val);
            }
        } catch (IOException ex) {
            throw new TException(ex);
        }
    }
326412
def _handle_constant(self, node, scope, ctxt, stream):
        
        self._dlog("handling constant type {}".format(node.type))
        switch = {
            "int": (self._str_to_int, self._choose_const_int_class),
            "long": (self._str_to_int, self._choose_const_int_class),
            # TODO this isn't quite right, but py010parser wouldn't have
            # parsed it if it wasn't correct...
            "float": (lambda x: float(x.lower().replace("f", "")), fields.Float),
            "double": (float, fields.Double),

            # cut out the quotes
            "char": (lambda x: ord(utils.string_escape(x[1:-1])), fields.Char),

            # TODO should this be unicode?? will probably bite me later...
            # cut out the quotes
            "string": (lambda x: str(utils.string_escape(x[1:-1])), fields.String)
        }

        if node.type in switch:
            #return switch[node.type](node.value)
            conversion,field_cls = switch[node.type]
            val = conversion(node.value)

            if hasattr(field_cls, "__call__") and not type(field_cls) is type:
                field_cls = field_cls(val)

            field = field_cls()
            field._pfp__set_value(val)
            return field

        raise UnsupportedConstantType(node.coord, node.type)
1018982
function stringInterner() { // eslint-disable-line no-unused-vars
  const strings = [];
  const ids = {};
  return {
    intern: function internString(s) {
      const find = ids[s];
      if (find === undefined) {
        const id = strings.length;
        ids[s] = id;
        strings.push(s);
        return id;
      } else {
        return find;
      }
    },
    get: function getString(id) {
      return strings[id];
    },
  };
}
524854
function() {
			var me = this;
			var labels = me.getLabels();
			me.minIndex = 0;
			me.maxIndex = labels.length - 1;
			var findIndex;

			if (me.options.ticks.min !== undefined) {
				// user specified min value
				findIndex = helpers.indexOf(labels, me.options.ticks.min);
				me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;
			}

			if (me.options.ticks.max !== undefined) {
				// user specified max value
				findIndex = helpers.indexOf(labels, me.options.ticks.max);
				me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;
			}

			me.min = labels[me.minIndex];
			me.max = labels[me.maxIndex];
		}
459770
def spark_string(ints):
    """"""
    ticks = u'▁▂▃▅▆▇'
    ints = [i for i in ints if type(i) == int]
    if len(ints) == 0:
        return ""
    step = (max(ints) / float(len(ticks) - 1)) or 1
    return u''.join(
        ticks[int(round(i / step))] if type(i) == int else u'.' for i in ints)
348202
def _str(self, i, x):
        
        FMT = {
            'a':self._fmt_auto,
            'i':self._fmt_int,
            'f':self._fmt_float,
            'e':self._fmt_exp,
            't':self._fmt_text,
            }

        n = self._precision
        dtype = self._dtype[i]
        try:
            if callable(dtype):
                return dtype(x)
            else:
                return FMT[dtype](x, n=n)
        except FallbackToText:
            return self._fmt_text(x)
913016
function checkValue(i) {
  const start = i;
  let l;
  let s;
  let _i;

  while (i < tokensLength) {
    if (checkDeclDelim(i)) break;

    s = checkSC(i);
    _i = i + s;

    if (l = _checkValue(_i)) i += l + s;
    if (!l || checkBlock(i - l)) break;
  }

  tokens[start].value_end = i;

  return i - start;
}
1212783
def default_value(cls, type_, expr):  # TODO: This function must be moved to api.xx
        
        assert isinstance(type_, symbols.TYPE)
        assert type_.is_basic
        assert check.is_static(expr)

        if isinstance(expr, (symbols.CONST, symbols.VAR)):  # a constant expression like @label + 1
            if type_ in (cls.TYPE(TYPE.float_), cls.TYPE(TYPE.string)):
                syntax_error(expr.lineno, "Can't convert non-numeric value to {0} at compile time".format(type_.name))
                return ['<ERROR>']

            val = Translator.traverse_const(expr)
            if type_.size == 1:  # U/byte
                if expr.type_.size != 1:
                    return ['#({0}) & 0xFF'.format(val)]
                else:
                    return ['#{0}'.format(val)]

            if type_.size == 2:  # U/integer
                if expr.type_.size != 2:
                    return ['##({0}) & 0xFFFF'.format(val)]
                else:
                    return ['##{0}'.format(val)]

            if type_ == cls.TYPE(TYPE.fixed):
                return ['0000', '##({0}) & 0xFFFF'.format(val)]

            # U/Long
            return ['##({0}) & 0xFFFF'.format(val), '##(({0}) >> 16) & 0xFFFF'.format(val)]

        if type_ == cls.TYPE(TYPE.float_):
            C, DE, HL = _float(expr.value)
            C = C[:-1]  # Remove 'h' suffix
            if len(C) > 2:
                C = C[-2:]

            DE = DE[:-1]  # Remove 'h' suffix
            if len(DE) > 4:
                DE = DE[-4:]
            elif len(DE) < 3:
                DE = '00' + DE

            HL = HL[:-1]  # Remove 'h' suffix
            if len(HL) > 4:
                HL = HL[-4:]
            elif len(HL) < 3:
                HL = '00' + HL

            return [C, DE[-2:], DE[:-2], HL[-2:], HL[:-2]]

        if type_ == cls.TYPE(TYPE.fixed):
            value = 0xFFFFFFFF & int(expr.value * 2 ** 16)
        else:
            value = int(expr.value)

        result = [value, value >> 8, value >> 16, value >> 24]
        result = ['%02X' % (v & 0xFF) for v in result]
        return result[:type_.size]
204969
def tickSize(self, tickerId, field, size):
        """"""
        return _swigibpy.EWrapper_tickSize(self, tickerId, field, size)
743672
def str(self, value, tolerant=False, limit=1000, seen=frozenset()):
        """"""
        if value is None:
            if tolerant:
                return ""

            raise ValueError("value is None")

        if isinstance(value, (bool, numbers.Number, basestring)):
            return str(value)

        if not isinstance(value, collections.Iterable):
            if not tolerant:
                raise ValueError("unknown value type")

            try:
                name = value.name
            except AttributeError:
                try:
                    name = value.__name__
                except AttributeError:
                    try:
                        name = value.__class__.__name__
                    except AttributeError:
                        return "<?>"

            return "<%s>" % (name,)

        is_mapping = isinstance(value, collections.Mapping)

        if not seen:
            wrap = "%s"
        elif is_mapping:
            wrap = "{%s}"
        else:
            wrap = "[%s]"

        id_ = id(value)
        if id_ in seen:
            if tolerant:
                return wrap % ("...",)
            raise ValueError("recursive representation")
        seen = seen.union((id_,))

        if is_mapping:
            items = [(self.str(n, tolerant=tolerant, limit=limit, seen=seen),
                      self.str(v, tolerant=tolerant, limit=limit, seen=seen))
                     for n, v in value.items()]
            items.sort()
            items = ("%s=%s" for n, v in items)
        else:
            it = iter(value)
            items = [self.str(item, tolerant=tolerant, limit=limit, seen=seen)
                     for item in itertools.islice(
                         it,
                         len(value)
                         if isinstance(value, collections.Sized)
                         else limit)]
            items.sort()
            try:
                next(it)
            except StopIteration:
                pass
            else:
                if not tolerant:
                    raise ValueError("iterable too long")
                items.append("...")

        return wrap % (", ".join(items),)
1040129
def _write_value(self, field_type, value):
        
        if len(field_type) > 1:
            # We don't need details for arrays and objects
            field_type = field_type[0]

        if field_type == self.TYPE_BOOLEAN:
            self._writeStruct(">B", 1, (1 if value else 0,))
        elif field_type == self.TYPE_BYTE:
            self._writeStruct(">b", 1, (value,))
        elif field_type == self.TYPE_CHAR:
            self._writeStruct(">H", 1, (ord(value),))
        elif field_type == self.TYPE_SHORT:
            self._writeStruct(">h", 1, (value,))
        elif field_type == self.TYPE_INTEGER:
            self._writeStruct(">i", 1, (value,))
        elif field_type == self.TYPE_LONG:
            self._writeStruct(">q", 1, (value,))
        elif field_type == self.TYPE_FLOAT:
            self._writeStruct(">f", 1, (value,))
        elif field_type == self.TYPE_DOUBLE:
            self._writeStruct(">d", 1, (value,))
        elif field_type == self.TYPE_OBJECT or field_type == self.TYPE_ARRAY:
            if value is None:
                self.write_null()
            elif isinstance(value, JavaEnum):
                self.write_enum(value)
            elif isinstance(value, (JavaArray, JavaByteArray)):
                self.write_array(value)
            elif isinstance(value, JavaObject):
                self.write_object(value)
            elif isinstance(value, JavaString):
                self.write_string(value)
            elif isinstance(value, str):
                self.write_blockdata(value)
            else:
                raise RuntimeError("Unknown typecode: {0}".format(field_type))
        else:
            raise RuntimeError("Unknown typecode: {0}".format(field_type))
1357303
function stringifyValue(value, replacer, space, indent) {
  // boolean, null, number, string, or date
  if (typeof value === 'boolean' || value instanceof Boolean ||
      value === null ||
      typeof value === 'number' || value instanceof Number ||
      typeof value === 'string' || value instanceof String ||
      value instanceof Date) {
    return JSON.stringify(value);
  }

  // lossless number, the secret ingredient :)
  if (value && value.isLosslessNumber) {
    return value.value;
  }

  // array
  if (Array.isArray(value)) {
    return stringifyArray(value, replacer, space, indent);
  }

  // object (test lastly!)
  if (value && typeof value === 'object') {
    return stringifyObject(value, replacer, space, indent);
  }

  return undefined;
}
895970
private int getIntValue(String str, int defaultValue) {

        try {
            int intValue = Integer.parseInt(str);
            return (intValue > 0) ? intValue : defaultValue;
        } catch (NumberFormatException e) {
            // intentionally left blank
        }
        return defaultValue;
    }
1265352
function(arrayOfValues) {
        var i = 0,
            currentLength,
            finishedString = '';

        for (; i < arrayOfValues.length; i++) {
            currentLength = i + 1;

            if (currentLength === arrayOfValues.length) {
                finishedString += ' and ' + arrayOfValues[i];
            }
            else if (i === 0) {
                finishedString += arrayOfValues[i];
            }
            else {
                finishedString += ', ' + arrayOfValues[i];
            }
        }

        return finishedString;
    }
88552
def wrap_formatter(formatter):
    
    if isinstance(formatter, ticker.Formatter):
        return formatter
    elif callable(formatter):
        args = [arg for arg in _getargspec(formatter).args
                if arg != 'self']
        wrapped = formatter
        if len(args) == 1:
            def wrapped(val, pos=None):
                return formatter(val)
        return ticker.FuncFormatter(wrapped)
    elif isinstance(formatter, basestring):
        if re.findall(r"\{(\w+)\}", formatter):
            return ticker.StrMethodFormatter(formatter)
        else:
            return ticker.FormatStrFormatter(formatter)
672210
private Object convertStringToSingleValue(String rawValue, ExtendedAttributeDefinition attrDef, EvaluationContext context,
                                              boolean ignoreWarnings) throws ConfigEvaluatorException {
        String value = processString(rawValue, attrDef, context, ignoreWarnings);
        return evaluateString(value, attrDef, context);
    }