def METHOD_NAME(**kwargs):
    registered_keys = []
    for key, definition in items(kwargs):
        if isinstance(definition, ModelBase):
            decoder = PathDecoder(
                model=definition,
                name=camel_to_snake(definition.__name__),
            )
        elif isinstance(definition, property):
            assert False, f'Got a property for {key}. Maybe you did Foo.pk? In that case write just Foo, or Foo.id.'
        elif isinstance(definition, DeferredAttribute):
            field = definition.field
            model = field.model
            attr = field.name
            decoder = PathDecoder(
                decode=lambda string, _model=model, _attr=attr, **_: _model.objects.get(**{attr: string}),
                name=camel_to_snake(model.__name__),
            )
        elif callable(definition):
            decoder = PathDecoder(
                decode=definition,
                name=key,
            )
        else:
            assert isinstance(definition, PathDecoder)
            decoder = definition
        _path_component_to_decode_data[key] = (None, key, None, decoder)
        registered_keys.append(key)
    @contextmanager
    def _unregister():
        try:
            yield
        finally:
            for key in registered_keys:
                del _path_component_to_decode_data[key]
    return _unregister()