def _container_start_handler_factory(ion_type, before_yield=lambda c, ctx: None):
    """Generates handlers for tokens that begin with container start characters.

    Args:
        ion_type (IonType): The type of this container.
        before_yield (Optional[callable]): Called at initialization. Accepts the first character's ordinal and the
            current context; performs any necessary initialization actions.
    """
    assert ion_type.is_container

    @coroutine
    def container_start_handler(c, ctx):
        before_yield(c, ctx)
        yield
        yield ctx.event_transition(IonEvent, IonEventType.CONTAINER_START, ion_type, value=None)
    return container_start_handler
Generates handlers for tokens that begin with container start characters.

    Args:
        ion_type (IonType): The type of this container.
        before_yield (Optional[callable]): Called at initialization. Accepts the first character's ordinal and the
            current context; performs any necessary initialization actions.