def register_as(name, formatter_class):
 if (not isinstance(name, six.string_types)):
  warnings.warn(('Use parameter ordering: name, formatter_class (for: %s)' % formatter_class))
  _formatter_class = name
  name = formatter_class
  formatter_class = _formatter_class
 if isinstance(formatter_class, six.string_types):
  scoped_formatter_class_name = formatter_class
  formatter_class = LazyObject(scoped_formatter_class_name)
 assert (isinstance(formatter_class, LazyObject) or issubclass(formatter_class, Formatter))
 _formatter_registry[name] = formatter_class

def register_as ( name , formatter_class ) : if ( not isinstance ( name , six . string_types ) ) : warnings . warn ( ( 'Use parameter ordering: name, formatter_class (for: %s)' % formatter_class ) ) _formatter_class = name name = formatter_class formatter_class = _formatter_class if isinstance ( formatter_class , six . string_types ) : scoped_formatter_class_name = formatter_class formatter_class = LazyObject ( scoped_formatter_class_name ) assert ( isinstance ( formatter_class , LazyObject ) or issubclass ( formatter_class , Formatter ) ) _formatter_registry [ name ] = formatter_class
register formatter class with given name .