Return the named formatter function.  See the function
    "set_formatter" for details.
198810
def get_formatter(name):
    
    if name in ('self', 'instance', 'this'):
        return af_self
    elif name == 'class':
        return af_class
    elif name in ('named', 'param', 'parameter'):
        return af_named
    elif name in ('default', 'optional'):
        return af_default
#    elif name in ('anonymous', 'arbitrary', 'unnamed'):
#        return af_anonymous
    elif name in ('keyword', 'pair', 'pairs'):
        return af_keyword
    else:
        raise ValueError('unknown trace formatter %r' % name)
1051248
def get_formatter(self, handler):
        
        if isinstance(handler, logging.handlers.SysLogHandler):
            formatter = '[%(levelname)-9s]'
        else:
            formatter = '[%(asctime)s] [%(levelname)-9s]'

        for p in self.prefix:
            formatter += ' [%s]' % (p)
        formatter = formatter + ' %(message)s'
        return logging.Formatter(formatter)
768821
Formatter getFormatterProperty(String name, Formatter defaultValue) {
        String val = getProperty(name);
        try {
            if (val != null) {
                return (Formatter) getClassInstance(val).newInstance();
            }
        } catch (Exception ex) {
            // We got one of a variety of exceptions in creating the
            // class or creating an instance.
            // Drop through.
        }
        // We got an exception.  Return the defaultValue.
        return defaultValue;
    }
337957
def format_name(self):
        
        format_data = self.get_format_data()
        return Formatter().vformat(self.string_formatter, args=[], kwargs=format_data)
307143
public static function getPlaceholderFormatterDefinition(string $name): ?callable
    {
        if (!self::$formatters) {
            self::$formatters = self::initPlaceholderFormatters();
        }

        return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
    }
631920
def _make_string_formatter(f, offset=None):
  
  format = f
  delta = offset
  return lambda v: time.strftime(format, (_date(v, delta)).timetuple())
991434
def with_formatter(formatter):
    
    def _decorator_after_args(unwrapped):
        def _wrapped(self, *args, **kwargs):
            logging.debug('unwrapped: %s', unwrapped)
            logging.debug('self: %s', self)
            logging.debug('args: %s', args)
            logging.debug('kwargs: %s', kwargs)
            return_value = unwrapped(self, *args, **kwargs)
            if 'raw' in kwargs and kwargs['raw']:
                return return_value
            else:
                return formatter(return_value)
        return _wrapped
    return _decorator_after_args
1174775
def _value_formatter(self, float_format=None, threshold=None):
        

        # the float_format parameter supersedes self.float_format
        if float_format is None:
            float_format = self.float_format

        # we are going to compose different functions, to first convert to
        # a string, then replace the decimal symbol, and finally chop according
        # to the threshold

        # when there is no float_format, we use str instead of '%g'
        # because str(0.0) = '0.0' while '%g' % 0.0 = '0'
        if float_format:
            def base_formatter(v):
                return float_format(value=v) if notna(v) else self.na_rep
        else:
            def base_formatter(v):
                return str(v) if notna(v) else self.na_rep

        if self.decimal != '.':
            def decimal_formatter(v):
                return base_formatter(v).replace('.', self.decimal, 1)
        else:
            decimal_formatter = base_formatter

        if threshold is None:
            return decimal_formatter

        def formatter(value):
            if notna(value):
                if abs(value) > threshold:
                    return decimal_formatter(value)
                else:
                    return decimal_formatter(0.0)
            else:
                return self.na_rep

        return formatter
522271
def _get_formatter(self, json):
        '''
        
        '''
        if json:
            return jsonlogger.JsonFormatter()
        else:
            return logging.Formatter(self.format_string)
1011977
def configure_formatter(self, config):
        """"""
        if '()' in config:
            factory = config['()'] # for use in exception handler
            try:
                result = self.configure_custom(config)
            except TypeError, te:
                if "'format'" not in str(te):
                    raise
                #Name of parameter changed from fmt to format.
                #Retry with old name.
                #This is so that code can be used with older Python versions
                #(e.g. by Django)
                config['fmt'] = config.pop('format')
                config['()'] = factory
                result = self.configure_custom(config)
        else:
            fmt = config.get('format', None)
            dfmt = config.get('datefmt', None)
            result = logging.Formatter(fmt, dfmt)
        return result
1289556
def formatter_class(klass):
    

    def decorator(func):
        adaptor = ScriptAdaptor._get_adaptor(func)
        adaptor.formatter_class = klass
        return func
    return decorator
231517
def localize(self, formatter, translator):
        
        return self.localizable_string.localize(
            formatter,
            translator,
            *self.args,
            **self.kwargs
        )
1095393
function getFormatFunction(name) {
  // lookup format
  const fmt = formats[name] || name || formats.default;
  // return compiled format
  return typeof fmt !== 'function' ? compile(fmt) : fmt;
}
214853
def auto_string_formatter(func):
    
    @wraps(func)
    def auto_string_formatter_wrapper(function, *args, **kwargs):
        if isinstance(function, string_types):
            function = StringFormatter(function)

        return func(function, *args, **kwargs)

    return auto_string_formatter_wrapper
1059804
def name(function):
    
    if isinstance(function, types.FunctionType):
        return function.__name__
    else:
        return str(function)
34141
private static String formatName( String name )
    {
        if ( name.length() < NAME_COL_WIDTH )
        {
            return name;
        }
        return name.substring( 0, NAME_COL_WIDTH - 1 ) + ">";
    }
1349037
def get_func_name(func):
    """"""
    func_name = getattr(func, '__name__', func.__class__.__name__)
    module_name = func.__module__

    if module_name is not None:
        module_name = func.__module__
        return '{}.{}'.format(module_name, func_name)

    return func_name