<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ipopo_setup_callback(cls, context):
 # type: (type, FactoryContext) -> None """ Sets up the class _callback dictionary :param cls: The class to handle :param context: The factory class context """

    assert inspect.isclass(cls)
    assert isinstance(context, FactoryContext)

    if context.callbacks is not None:
        callbacks = context.callbacks.copy()
    else:
        callbacks = {}

    functions = inspect.getmembers(cls, inspect.isroutine)

    for _, func in functions:
        if not hasattr(func, constants.IPOPO_METHOD_CALLBACKS):
            # No attribute, get the next member
            continue

        method_callbacks = getattr(func, constants.IPOPO_METHOD_CALLBACKS)
        if not isinstance(method_callbacks, list):
            # Invalid content
            _logger.warning(
                "Invalid callback information %s in %s",
                constants.IPOPO_METHOD_CALLBACKS,
                get_method_description(func),
            )
            continue

        # Keeping it allows inheritance : by removing it, only the first
        # child will see the attribute -> Don't remove it

        # Store the call backs
        for _callback in method_callbacks:
            if _callback in callbacks and not is_from_parent(
                cls, callbacks[_callback].__name__, callbacks[_callback]
            ):
                _logger.warning(
                    "Redefining the callback %s in class '%s'.\n"
                    "\tPrevious callback : %s\n"
                    "\tNew callback : %s",
                    _callback,
                    cls.__name__,
                    get_method_description(callbacks[_callback]),
                    get_method_description(func),
                )

            callbacks[_callback] = func

    # Update the factory context
    context.callbacks.clear()
    context.callbacks.update(callbacks)