<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def invitation_backend(backend=None, namespace=None):
 # type: (Optional[Text], Optional[Text]) -> BaseBackend """ Returns a specified invitation backend Args: backend: dotted path to the invitation backend class namespace: URL namespace to use Returns: an instance of an InvitationBackend """

    backend = backend or ORGS_INVITATION_BACKEND
    class_module, class_name = backend.rsplit(".", 1)
    mod = import_module(class_module)
    return getattr(mod, class_name)(namespace=namespace)