def METHOD_NAME(self, classname, cls=None, module=None, is_template=False,
             baseclasses=None, filename=None, warn=False):
    '''Register a new classname referring to a real class or
    class definition in a module. Warn, if True will emit a warning message
    when a class is re-declared.
    .. versionchanged:: 1.9.0
        `warn` was added.
    .. versionchanged:: 1.7.0
        :attr:`baseclasses` and :attr:`filename` added
    .. versionchanged:: 1.0.5
        :attr:`is_template` has been added in 1.0.5.
    '''
    if cls is None and module is None and baseclasses is None:
        raise ValueError(
            'You must specify either cls= or module= or baseclasses =')
    if classname in self.classes:
        if warn:
            info = self.classes[classname]
            Logger.warning('Factory: Ignored class "{}" re-declaration. '
            'Current -  module: {}, cls: {}, baseclass: {}, filename: {}. '
            'Ignored -  module: {}, cls: {}, baseclass: {}, filename: {}.'.
            format(classname, info['module'], info['cls'],
                   info['baseclasses'], info['filename'], module, cls,
                   baseclasses, filename))
        return
    self.classes[classname] = {
        'module': module,
        'cls': cls,
        'is_template': is_template,
        'baseclasses': baseclasses,
        'filename': filename}