def METHOD_NAME(const, table):
    metadata = table.metadata
    convention = _get_convention(metadata.naming_convention, type(const))
    if isinstance(const.name, conv):
        return const.name
    elif convention is not None and \
        not isinstance(const.name, conv) and \
            (
            const.name is None or
            "constraint_name" in convention or
            isinstance(const.name, _defer_name)):
        return conv(
            convention % ConventionDict(const, table,
                                        metadata.naming_convention)
        )
    elif isinstance(convention, _defer_none_name):
        return None