Get the type of a given value
760835
protected final int getNodeType( Object value )
    {   	
        if (value instanceof String)
            return SelectorNodeType.STRING;
            
        if (value instanceof Boolean)
            return SelectorNodeType.BOOLEAN;
        
        return SelectorNodeType.NUMBER;
    }
901985
def check_type(value, type_def):
        
        if type_def == 'integer':
            try:
                # We accept string with integer ex: '123'
                int(value)
                return True
            except ValueError:
                return isinstance(value, six.integer_types) and not isinstance(value, bool)
        elif type_def == 'number':
            return isinstance(value, (six.integer_types, float)) and not isinstance(value, bool)
        elif type_def == 'string':
            return isinstance(value, (six.text_type, six.string_types, datetime.datetime))
        elif type_def == 'boolean':
            return (isinstance(value, bool) or
                    (isinstance(value, (six.text_type, six.string_types,)) and
                     value.lower() in ['true', 'false'])
                    )
        else:
            return False
30443
def check_type(self, value):
    

    if self.null and value is None:
      return
    if self.type is not None and not isinstance(value, self.type):
      msg = '{0!r} expected type {1}'
      raise TypeError(msg.format(self.full_name, self.type.__name__))
1324044
function getType(obj) {
    let typeStr = typeof(obj);
    if (obj) {
        return Array.isArray(obj) ? 'array' : typeStr;
    } else {
        switch (typeStr) {
            case 'number':
                return obj === 0 ? 'number' : 'NaN';
            case 'object':
                return 'null';
            default:
                return typeStr;
        }
    }
}
572927
def _process_value(self, value, type):
        

        if not isinstance(value, six.string_types + (list,)):
            value = json.dumps(value)
        return value
1219483
def getTypedValue(self, row):
        ''
        return wrapply(self.type, wrapply(self.getValue, row))
898541
def _get_type(name, value):
        
        # Types forced for known keys
        if name in TYPED_BOOL:
            return TYPE_BOOLEAN

        elif name in TYPED_LONG:
            return TYPE_LONG

        elif name in TYPED_STRING:
            return TYPE_STRING

        # We need to analyze the content of value
        if isinstance(value, (tuple, list, set)):
            # Get the type from container content
            try:
                # Extract value
                value = next(iter(value))

            except StopIteration:
                # Empty list, can't check
                return TYPE_STRING

        # Single value
        if isinstance(value, int):
            # Integer
            return TYPE_LONG

        elif isinstance(value, float):
            # Float
            return TYPE_DOUBLE

        elif isinstance(value, type(ElementTree.Element(None))):
            # XML
            return XML_VALUE

        # Default: String
        return TYPE_STRING
69451
def get_type(self):
        
        if self.total_size() == 0:
            return CONSTANT_TYPE_NULL
        return unpack_from(FMT_BE_INT, self._buffer, TYPE_OFFSET)[0]
451329
def _cast_to_type(self, value):
        
        try:
            return int(value)
        except (ValueError, TypeError):
            self.fail('invalid', value=value)
217597
def _cast_to_type(self, value):
        
        if isinstance(value, str) or value is None:
            return value
        return str(value)
1248770
def type_name(value):
    

    if inspect.isclass(value):
        cls = value
    else:
        cls = value.__class__
    if cls.__module__ in set(['builtins', '__builtin__']):
        return cls.__name__
    return '%s.%s' % (cls.__module__, cls.__name__)
802248
function getDataType(obj){
	var dataType = toClass.call( obj );
	dataType = dataType.split(' ')[1];
	dataType = dataType.substring(0, dataType.length-1);

	return dataType;
}
270231
def _guess_type(val):
        """"""
        if isinstance(val, bool):
            return "choice"
        elif isinstance(val, int):
            return "number"
        elif isinstance(val, float):
            return "number"
        elif isinstance(val, str):
            return "text"
        elif hasattr(val, 'read'):
            return "file"
        else:
            return "text"
1033887
def _type_convert(self, value):
        
        if value is None:
            return value

        try:
            return datetime.datetime.strptime(value, '%Y-%m-%d %H:%M:%S')
        except ValueError:
            pass

        try:
            return int(value)
        except ValueError:
            pass

        try:
            return decimal.Decimal(value)
        except decimal.InvalidOperation:
            pass

        return value
458064
function getType(obj) {
  if (obj === null) return 'null';
  if (typeof obj === undefined) return 'undefined';

  return Object.prototype.toString.call(obj)
          .match(/\s([a-zA-Z]+)/)[1]
          .toLowerCase();
}
419806
def is_type(value):
        """"""
        if isinstance(value, type):
            return issubclass(value, Type)
        return isinstance(value, Type)
387622
function ( value ) {
            var result = false;
    
            switch ( this.type(value) ) {
                case 'Object':
                    result = true;
                    for ( var key in value ) {
                        result = false;
                        break;
                    }
                    break;
                case 'Array':
                    result = value.length === 0;
                    break;
                case 'Null':
                    result = true;
                    break;
                case 'Undefined':
                    result = true;
                    break;
                case 'String':
                    result = '' === value;
                    break;
            }
    
            return result;
        }