def METHOD_NAME(namespace, info, objects, get_name=attrgetter('__name__'), color='cyan'):
    def _get_module(obj):
        segments = tuple(obj.__module__.split('.'))
        if segments[0].startswith('indico_'):  # plugin
            return f'plugin:{segments[0]}'
        elif segments[:2] == ('indico', 'modules'):
            return f'module:{segments[2]}'
        elif segments[:2] == ('indico', 'core'):
            return f'core:{segments[2]}'
        else:
            return '.'.join(segments[:-1] if len(segments) > 1 else segments)
    items = [(_get_module(obj), get_name(obj), obj) for obj in objects]
    for module, items in itertools.groupby(sorted(items, key=itemgetter(0, 1)), key=itemgetter(0)):
        names, elements = list(zip(*((x[1], x[2]) for x in items)))
        _add_to_context_multi(namespace, info, elements, names, doc=module, color=color)