Return the MRO of an object. Do regex on each element to remove the "<class..." bit.
356712
def get_parents(obj, **kwargs):
    """"""
    num_of_mro = kwargs.get("num_of_mro", 5)

    mro = getmro(obj.__class__)
    mro_string = ', '.join([extract_type(str(t)) for t in mro[:num_of_mro]])

    return "Hierarchy: {}".format(mro_string)
386091
function classOf (obj) {
  const class2type = {}
  'Boolean Number String Function Array Date RegExp Object tips'.split(' ')
  .forEach((e, i) => {
    class2type['[object ' + e + ']'] = e.toLowerCase()
  })
  if (obj == null) {
    return String(obj)
  }
  return typeof obj === 'object' || typeof obj === 'function'
    ? class2type[ class2type.toString.call(obj) ] || 'object'
    : typeof obj
}
855506
def _elements_to_dict(data, position, obj_end, opts, result=None):
    """"""
    if result is None:
        result = opts.document_class()
    end = obj_end - 1
    while position < end:
        key, value, position = _element_to_dict(data, position, obj_end, opts)
        result[key] = value
    if position != obj_end:
        raise InvalidBSON('bad object or element length')
    return result
27202
private static function getExtractorClosure($object)
    {
        if (!isset(self::$extractorClosure)) {
            self::$extractorClosure = function($object) {
                return get_object_vars($object);
            };
        }

        $class = get_class($object);

        if (!isset(self::$extractorClosureCache[$class])) {
            self::$extractorClosureCache[$class] = \Closure::bind(self::$extractorClosure, null, $class);
        }

        return self::$extractorClosureCache[$class];
    }
841477
def _decoder(self, obj):
        
        if '__class__' in obj:
            elem = eval(obj['__class__'])()
            elem.ident = obj['ident']
            elem.group = str(obj['group'])
            elem.name = str(obj['name'])
            elem.ctype = str(obj['ctype'])
            elem.pytype = str(obj['pytype'])
            elem.access = obj['access']
            return elem
        return obj
719688
def operator_from_str(op):
    
    d = {"==": operator.eq,
         "!=": operator.ne,
         ">": operator.gt,
         ">=": operator.ge,
         "<": operator.lt,
         "<=": operator.le,
         '+': operator.add,
         '-': operator.sub,
         '*': operator.mul,
         '%': operator.mod,
         '^': operator.xor,
         }

    try:
        d['/'] = operator.truediv
    except AttributeError:
        pass

    return d[op]
824532
def _decrypt_object(obj, translate_newlines=False):
    '''
    
    '''
    if salt.utils.stringio.is_readable(obj):
        return _decrypt_object(obj.getvalue(), translate_newlines)
    if isinstance(obj, six.string_types):
        return _decrypt_ciphertexts(obj, translate_newlines=translate_newlines)
    elif isinstance(obj, dict):
        for key, value in six.iteritems(obj):
            obj[key] = _decrypt_object(value,
                                       translate_newlines=translate_newlines)
        return obj
    elif isinstance(obj, list):
        for key, value in enumerate(obj):
            obj[key] = _decrypt_object(value,
                                       translate_newlines=translate_newlines)
        return obj
    else:
        return obj
1185549
def _elements_to_dict(data, position, obj_end, opts, subdocument=None):
    """"""
    if type(opts.document_class) == tuple:
        result = opts.document_class[0](**opts.document_class[1]) if not subdocument else dict()
    else:
        result = opts.document_class() if not subdocument else dict()
    end = obj_end - 1
    while position < end:
        (key, value, position) = _element_to_dict(data, position, obj_end, opts)
        result[key] = value
    return result
296624
def _elements_to_dict(data, position, obj_end, opts):
    """"""
    result = opts.document_class()
    pos = position
    for key, value, pos in _iterate_elements(data, position, obj_end, opts):
        result[key] = value
    if pos != obj_end:
        raise InvalidBSON('bad object or element length')
    return result
1024319
def get_class(context, field, obj=None):
    
    view = context['view']
    return view.lookup_field_class(field, obj, "field_" + field)
896955
def val_to_mrc(code, val):
    
    code = str(code)
    if len(code) < 3:
        code += (3 - len(code)) * " "

    return "%s   L %s" % (code, val)
926416
function (object) {
  if (typeof HTMLElement === 'object') {
    return object instanceof HTMLElement;
  } else {
    return object &&
      typeof object === 'object' &&
      'nodeType' in object &&
      object.nodeType === 1 &&
      typeof object.nodeName === 'string';
  }
}
170248
function (object) {
		if (!object || object._bsontype)
			return object;

		if (_.isString(object))
			return object.replace(/\./g, "U+FF0E").replace(/\$/g, "U+FF04");

		var newObject = _.isArray(object) ? [ ] : { };

		Object.keys(object).forEach(function (key) {
			var sKey = key;
			
			if (/[.|$]/.test(key)) {
				sKey = mongojs.util.sanitise(key);
				newObject[sKey] = object[key];
			} else {
				newObject[key] = object[key];
			}
			
			// Recurse
			if (isObject(newObject[sKey]))
				newObject[sKey] = this.sanitise(newObject[sKey]);
		}.bind(this));
		
		return newObject;
	}
882304
def match(self, item):
        
        val = (getattr(item, self._name) or '').lower()
        result = self._matcher(val) if self._is_regex else self._matcher(val, item)
        if 0:
            log.debug("%r for %r ~ %r, name %r, item %r" % (
                result, val, self._value, self._name, item))
        return result
4156
def extract(self, obj, bypass_ref=False):
        
        for token in self.tokens:
            obj = token.extract(obj, bypass_ref)
        return obj
210053
private function getClassName($object)
    {
        $class = get_class($object);
        if (($index = strrpos($class, '\\'))) {
            $fixForTrailingBackslash = 1;

            return substr($class, $index + $fixForTrailingBackslash);
        }

        return $class;
    }
1310423
def make_ro(obj: Any, forgive_type=False):
    

    if isinstance(obj, (str, bytes, int, float, bool, RoDict, RoList)) \
            or obj is None:
        return obj
    elif isinstance(obj, Mapping):
        return RoDict(obj, forgive_type)
    elif isinstance(obj, Sequence):
        return RoList(obj, forgive_type)
    elif forgive_type:
        return obj
    else:
        raise ValueError('Trying to make read-only an object of type "{}"'
                         .format(obj.__class__.__name__))