def register_widget(self, place=None, type=None, widget=None, filter=None,<EOL>**kwargs):
if bool(widget) == bool(place or type):<EOL><INDENT>raise InvalidArgumentError(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>widget = widget or self.create_widget(place, type, **kwargs)<EOL>dynamic = any(map(callable, widget))<EOL>self._widgets.append((filter, dynamic, widget))<EOL>return widget<EOL>
Create (see :meth:`create_widget`) or use provided widget and register
it.

This method provides this dual behavior in order to simplify widget
creation-registration on an functional single step without sacrifycing
the reusability of a object-oriented approach.

:param place: where widget should be placed. This param conflicts
              with `widget` argument.
:type place: str or None
:param type: widget type name as taken from :attr:`widget_types` dict
             keys. This param conflicts with `widget` argument.
:type type: str or None
:param widget: optional widget object will be used as is. This param
               conflicts with both place and type arguments.
:type widget: object or None
:raises TypeError: if both widget and place or type are provided at
                   the same time (they're mutually exclusive).
:returns: created or given widget object
:rtype: object