def register(self, type):
def _decorator(func):<EOL><INDENT>if isinstance(type, tuple):<EOL><INDENT>for t in type:<EOL><INDENT>self.func_registry[t] = func<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.func_registry[type] = func<EOL><DEDENT>return func<EOL><DEDENT>return _decorator<EOL>
Registers a custom formatting function with ub.repr2