vprof/memory_profiler.py
def _format_obj_count(objects):
    """Formats object count."""
    result = []
    regex = re.compile(r'<(?P<type>\w+) \'(?P<name>\S+)\'>')
    for obj_type, obj_count in objects.items():
        if obj_count != 0:
            match = re.findall(regex, repr(obj_type))
            if match:
                obj_type, obj_name = match[0]
                result.append(("%s %s" % (obj_type, obj_name), obj_count))
    return sorted(result, key=operator.itemgetter(1), reverse=True)
def _format_obj_count(objects):
    result = []
    regex = re.compile(r'<(?P<type>\w+) \'(?P<name>\S+)\'>')
    for obj_type, obj_count in objects.items():
        if obj_count != 0:
            match = re.findall(regex, repr(obj_type))
            if match:
                obj_type, obj_name = match[0]
                result.append(("%s %s" % (obj_type, obj_name), obj_count))
    return sorted(result, key=operator.itemgetter(1), reverse=True)
def _format_obj_count ( objects ) : result = [ ] regex = re . compile ( r'<(?P<type>\w+) \'(?P<name>\S+)\'>' ) for obj_type , obj_count in objects . items ( ) : if obj_count != 0 : match = re . findall ( regex , repr ( obj_type ) ) if match : obj_type , obj_name = match [ 0 ] result . append ( ( "%s %s" % ( obj_type , obj_name ) , obj_count ) ) return sorted ( result , key = operator . itemgetter ( 1 ) , reverse = True )
Formats object count.
Formats object count .