def __init__(self, formatters, predicates, template_registry):
        """
    Args:
      formatters: See docstring for _CompileTemplate
      predicates: See docstring for _CompileTemplate
    """
        self.current_section = _Section(None)
        self.stack = [self.current_section]
        
        # Passing a dictionary or a function is often more convenient than making a
        # FunctionRegistry
        if isinstance(formatters, dict):
            formatters = DictRegistry(formatters)
        elif callable(formatters):
            formatters = CallableRegistry(formatters)
        
        # default formatters with arguments
        default_formatters = PrefixRegistry([
            ('pluralize', _Pluralize),
            ('cycle', _Cycle),
            # These have to go first because 'strftime' is a prefix of
            # strftime-local/gm!
            ('strftime-local', _StrftimeLocal),  # local
            ('strftime-gm', _StrftimeGm),  # world
            ('strftime', _StrftimeLocal),  # local by default
        ])
        
        # First consult user formatters, then templates enabled by
        # MakeTemplateGroup, then the default formatters
        self.formatters = ChainedRegistry([
            formatters,
            template_registry,  # returns _TemplateRef instances
            DictRegistry(_DEFAULT_FORMATTERS),
            default_formatters])
        
        # Same for predicates
        if isinstance(predicates, dict):
            predicates = DictRegistry(predicates)
        elif callable(predicates):
            predicates = CallableRegistry(predicates)
        
        # default predicates with arguments
        default_predicates = PrefixRegistry([
            ('test', _TestAttribute),
            ('template', _TemplateExists),
        ])
        
        self.predicates = ChainedRegistry(
            [predicates, DictRegistry(_DEFAULT_PREDICATES), default_predicates])
def __init__ ( self , formatters , predicates , template_registry ) : self . current_section = _Section ( None ) self . stack = [ self . current_section ] if isinstance ( formatters , dict ) : formatters = DictRegistry ( formatters ) elif callable ( formatters ) : formatters = CallableRegistry ( formatters ) default_formatters = PrefixRegistry ( [ ( 'pluralize' , _Pluralize ) , ( 'cycle' , _Cycle ) , ( 'strftime-local' , _StrftimeLocal ) , ( 'strftime-gm' , _StrftimeGm ) , ( 'strftime' , _StrftimeLocal ) , ] ) self . formatters = ChainedRegistry ( [ formatters , template_registry , DictRegistry ( _DEFAULT_FORMATTERS ) , default_formatters ] ) if isinstance ( predicates , dict ) : predicates = DictRegistry ( predicates ) elif callable ( predicates ) : predicates = CallableRegistry ( predicates ) default_predicates = PrefixRegistry ( [ ( 'test' , _TestAttribute ) , ( 'template' , _TemplateExists ) , ] ) self . predicates = ChainedRegistry ( [ predicates , DictRegistry ( _DEFAULT_PREDICATES ) , default_predicates ] )
Args:
      formatters: See docstring for _CompileTemplate
      predicates: See docstring for _CompileTemplate