Isolated AST code to determine if a value is textual (strings and numbers).
508401
function isTextual(type, value) {
  return t.logicalExpression(
    "||",
    t.binaryExpression("===", type, t.stringLiteral("number")),
    t.logicalExpression(
      "||",
      t.binaryExpression("===", type, t.stringLiteral("string")),
      t.logicalExpression(
        "&&",
        t.binaryExpression("===", type, t.stringLiteral("object")),
        t.binaryExpression("instanceof", value, t.identifier("String"))
      )
    )
  );
}
58081
def _is_string(thing):
    
    if (_py3k and isinstance(thing, str)):
        return True
    if (not _py3k and isinstance(thing, basestring)):
        return True
    return False
590079
def _parse_value(value):
    ''''''
    if isinstance(value, bool):
        return 'true' if value else 'false'
    elif isinstance(value, six.string_types):
        # parse compacted notation to dict
        listparser = re.compile(r'''((?:[^,"']|"[^"]*"|'[^']*')+)''')

        value = value.strip()
        if value.startswith('[') and value.endswith(']'):
            return listparser.split(value[1:-1])[1::2]
        elif value.startswith('(') and value.endswith(')'):
            rval = {}
            for pair in listparser.split(value[1:-1])[1::2]:
                pair = pair.split('=')
                if '"' in pair[1]:
                    pair[1] = pair[1].replace('"', '')
                if pair[1].isdigit():
                    rval[pair[0]] = int(pair[1])
                elif pair[1] == 'true':
                    rval[pair[0]] = True
                elif pair[1] == 'false':
                    rval[pair[0]] = False
                else:
                    rval[pair[0]] = pair[1]
            return rval
        else:
            if '"' in value:
                value = value.replace('"', '')
            if value.isdigit():
                return int(value)
            elif value == 'true':
                return True
            elif value == 'false':
                return False
            else:
                return value
    else:
        return value
694819
def _isint(string):
    
    return type(string) is int or \
           (isinstance(string, _binary_type) or isinstance(string, _text_type)) and \
           _isconvertible(int, string)
290358
def _check_if_states_are_strings(cls):
        """"""
        for item in list(cls.context.states_enum):
            if not isinstance(item.value, six.string_types):
                raise ValueError(
                    'Item {name} is not string. Only strings are allowed.'
                    .format(name=item.name)
                )
53682
function isString(value) {
    return typeof value == 'string' ||
      value && typeof value == 'object' && toString.call(value) == stringClass || false;
  }
792216
function stringMatch(stringValues) {
	return function(testValue) {
		for (var i = stringValues.length - 1; i >= 0; i--) {
			if (stringValues[i] === testValue) {
				return true;
			}
		}
		return false;
	};
}
486032
def is_literal_number?(value)
      value.is_a?(Literal) &&
        value.value.is_a?((Sass::Script::Value::Number)) &&
        !value.value.original.nil?
    end
497868
function isStrict(node) {
        if (node.type === 'Program' && node.sourceType === 'module') 
            return true;
        var nodes;
        if (node.type === 'Program') 
            nodes = node.body;
         else if (examine(node).isFunction) 
            nodes = node.body.body;
         else 
            return false;
        if (nodes) 
            for (var i = 0;i < nodes.length; i++) 
            if (examine(nodes[i]).isDirective && nodes[i].expression.value.match(/^\s*use\s+strict\s*$/)) 
            return true;
        return false;
    }
218147
def is_type_text_string(obj):
    """"""
    if PY2:
        # Python 2
        return type(obj) in [str, unicode]
    else:
        # Python 3
        return type(obj) in [str, bytes]
391923
def ensure_object_is_string(item, title):
    
    assert isinstance(title, str)

    if not isinstance(item, str):
        msg = "{} must be a string. {} passed instead."
        raise TypeError(msg.format(title, type(item)))

    return None
935693
public static boolean isNumeric(Object value) {
		if (value == null) return false;
		if (value instanceof Number) return true;
		if (value instanceof String) {
			String stringValue = (String) value;
			if (isNullOrEmpty(stringValue)) return true;
			return isNumber(stringValue);
		}
		return false;
	}
5298
def is_quoted(value):
    '''
    
    '''
    ret = ''
    if isinstance(value, six.string_types) \
            and value[0] == value[-1] \
            and value.startswith(('\'', '"')):
        ret = value[0]
    return ret
435962
def is_symbol(string):
    
    return (
        is_int(string) or is_float(string) or
        is_constant(string) or is_unary(string) or
        is_binary(string) or
        (string == '(') or (string == ')')
    )
426131
def is_integer(self, value, strict=False):
        """"""
        if value is not None:
            if isinstance(value, numbers.Number):
                return
        value = stringify(value)
        if value is not None and value.isnumeric():
            return
        self.shout('value %r is not an integer', strict, value)
132892
def is_numeric(self, value, strict=False):
        """"""
        value = stringify(value)
        if value is not None:
            if value.isnumeric():
                return
        self.shout('value %r is not numeric', strict, value)
702392
def _isnumber(string):
    
    if not _isconvertible(float, string):
        return False
    elif isinstance(string, (_text_type, _binary_type)) and (
            math.isinf(float(string)) or math.isnan(float(string))):
        return string.lower() in ['inf', '-inf', 'nan']
    return True