def METHOD_NAME(doc):
    functions = []
    macros = []
    messages = []
    constants = []
    properties = []
    structs = []
    enums = []
    typedefs = []
    methods = []
    for e in doc['elements']:
        if e['type'] == 'FUNCTION':
            functions.append(e)
        if e['type'] == 'MACRO':
            macros.append(e)
        elif e['type'] == 'MESSAGE':
            messages.append(e)
        elif e['type'] == 'VARIABLE':
            constants.append(e)
        elif e['type'] == 'PROPERTY':
            properties.append(e)
        elif e['type'] == 'STRUCT':
            structs.append(e)
        elif e['type'] == 'ENUM':
            enums.append(e)
        elif e['type'] == 'TYPEDEF':
            typedefs.append(e)
        elif e['type'] == 'METHOD':
            methods.append(e)
    t = {}
    t['functions'] = functions
    t['methods'] = methods
    t['macros'] = macros
    t['messages'] = messages
    t['constants'] = constants
    t['properties'] = properties
    t['structs'] = structs
    t['enums'] = enums
    t['typedefs'] = typedefs
    t['info'] = doc['info']
    return t