human
Solve the following python programming problem given the following code:
@contextmanager
def capture_registrations():
assistant
#Here is the Python code you requested.

    """Testing utility for capturing registrations.
    :param confirmation_sent_at: An optional datetime object to set the
    user\s `confirmation_sent_at` to
    """
    registrations = []
    def _on(app, **data):
        registrations.append(data)
    user_registered.connect(_on)
    try:
        (yield registrations)
    finally:
        user_registered.disconnect(_on)