def METHOD_NAME(pkg, definitions):
    def format_definition_ref(definition: Definition):
        if pkg == definition.m_parent:
            return definition.name
        else:
            python_module = definition.m_parent.a_legacy.python_module
            return '%s.%s' % (python_module.split('.')[-1], definition.name)
    return ', '.join([format_definition_ref(definition) for definition in definitions])