def METHOD_NAME(cls, regions, classobj, format=None, **kwargs):
    """
    Serialize to a regions string or table.
    """
    if format is None:
        cls._no_format_error(classobj)
    key = (classobj, 'serialize', format)
    try:
        serializer = cls.registry[key]
    except KeyError:
        msg = (f'No serializer defined for format "{format}" and class '
               f'"{classobj.__name__}".\n'
               f'{cls._get_format_table_str(classobj)}')
        raise IORegistryError(msg) from None
    return serializer(regions, **kwargs)