Return type string of an object.
437991
def get_type_string(item):
    """"""
    if isinstance(item, DataFrame):
        return "DataFrame"
    if isinstance(item, Index):
        return type(item).__name__
    if isinstance(item, Series):
        return "Series"
    found = re.findall(r"<(?:type|class) '(\S*)'>",
                       to_text_string(type(item)))
    if found:
        return found[0]
925066
def get_object_name(object):
    

    if type(object) is property:
        return object.fget.__name__
    elif hasattr(object, "__name__"):
        return object.__name__
    elif hasattr(object, "__class__"):
        return object.__class__.__name__
    else:
        return NULL_OBJECT_NAME
630845
def _to_string(val):
    """"""
    if isinstance(val, binary_type):
        return val.decode('utf-8')
    assert isinstance(val, text_type)
    return val
160462
def dump_type(self, obj):
        """"""
        if not isinstance(obj.relation_type, RelationType):
            return resolve_relation_type_config(obj.relation_type).name
        else:
            return obj.relation_type.name
422810
def str2type(value):
    
    if not isinstance(value, str):
        return value
    try:
        return json.loads(value)
    except JSONDecodeError:
        return value
1056328
def identify(self, obj):
    """"""
    hash_ = hash(obj)
    type_id = self.to_id(type(obj))
    return (hash_, TypeId(type_id))
233547
def get_object_as_string(obj):
    
    if isinstance(obj, str):
        return obj
    if isinstance(obj, list):
        return '\r\n\;'.join([get_object_as_string(item) for item in obj])
    attrs = vars(obj)
    as_string = ', '.join("%s: %s" % item for item in attrs.items())
    return as_string
1143712
def get_types(obj, **kwargs):
    """"""
    max_iterable_length = kwargs.get('max_iterable_length', 100000)

    it, = itertools.tee(obj, 1)
    s = set()

    too_big = False

    for i, v in enumerate(it):
        if i <= max_iterable_length:
            s.add(type(v))
        else:
            too_big = True
            break

    return {"types": s, "too_big": too_big}
1328880
function type (prop) {
  var rs = Object.prototype.toString.call(prop);
  return rs.slice(8, rs.length - 1).toLowerCase();
}
593657
function getType(key, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return undefined;
  return val.rtype || TYPE_NAMES.STRING;
}
895279
function determineType(obj) {
    var type;
    var typeValue;
    var name;

    if (value(obj).typeOf(Object)) {
        type = obj.type || "Object";
    } else {
        type = obj;
    }

    typeValue = value(type);

    if (typeValue.typeOf(String)) {
        name = type.charAt(0).toUpperCase() + type.substring(1);
        return supportedTypes.indexOf(name) === -1 ? "String" : name;
    } else if (typeValue.typeOf(Function)) {
        name = type.toString().match(fnName)[1];
    } else if (typeValue.typeOf(Object)) {
        if (type.type) {
            name = type.type;
        } else {
            return "Object";
        }
    } else {
        name = type.constructor.toString().match(fnName)[1];
    }

    if (supportedTypes.indexOf(name) === -1) {
        throw new TypeError("Type '" + name + "' is not supported");
    }

    return name;
}
1081898
def string(v):
    """"""
    if nodesetp(v):
        if not v:
            return u''
        return string_value(v[0])
    elif numberp(v):
        if v == float('inf'):
            return u'Infinity'
        elif v == float('-inf'):
            return u'-Infinity'
        elif str(v) == 'nan':
            return u'NaN'
        elif int(v) == v and v <= 0xffffffff:
            v = int(v)
        return unicode(v)
    elif booleanp(v):
        return u'true' if v else u'false'
    return v
826074
def get_tuple(self):
        """"""
        objType, objInstance = self.value

        if isinstance(objType, int):
            pass
        elif isinstance(objType, str):
            # turn it back into an integer
            objType = self.objectTypeClass()[objType]
        else:
            raise TypeError("invalid datatype for objType")

        # pack the components together
        return (objType, objInstance)
411598
def _ToString(x):
    """"""
    # Some cross-language values for primitives.  This is tested in
    # jsontemplate_test.py.
    if x is None:
        return 'null'
    if isinstance(x, six.string_types):
        return x
    return pprint.pformat(x)
138676
def type_str(self, short=False):
        
        if short:
            return javabridge.static_call(
                "weka/core/Attribute", "typeToStringShort", "(Lweka/core/Attribute;)Ljava/lang/String;",
                self.jobject)
        else:
            return javabridge.static_call(
                "weka/core/Attribute", "typeToString", "(Lweka/core/Attribute;)Ljava/lang/String;",
                self.jobject)
690072
def _checkType(self, obj, identifier):
        """"""
        if not isinstance(obj, basestring):
            raise TypeError("expected %s '%s' to be a string (was '%s')" %
                            (identifier, obj, type(obj).__name__))
1048627
def to_string(type):
        
        if type == None:
            return "unknown"
        elif type == TypeCode.Unknown:
            return "unknown"
        elif type == TypeCode.String:
            return "string"
        elif type == TypeCode.Integer:
            return "integer"
        elif type == TypeCode.Long:
            return "long"
        elif type == TypeCode.Float:
            return "float"
        elif type == TypeCode.Double:
            return "double"
        elif type == TypeCode.Duration:
            return "duration"
        elif type == TypeCode.DateTime:
            return "datetime"
        elif type == TypeCode.Object:
            return "object"
        elif type == TypeCode.Enum:
            return "enum"
        elif type == TypeCode.Array:
            return "array"
        elif type == TypeCode.Map:
            return "map"
        else:
            return "unknown"