<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _on(on_signals, callback, max_calls=None):
 """ Proxy for `smokesignal.on`, which is compatible as both a function call and a decorator. This method cannot be used as a decorator :param signals: A single signal or list/tuple of signals that callback should respond to :param callback: A callable that should repond to supplied signal(s) :param max_calls: Integer maximum calls for callback. None for no limit. """

    if not callable(callback):
        raise AssertionError('Signal callbacks must be callable')

    # Support for lists of signals
    if not isinstance(on_signals, (list, tuple)):
        on_signals = [on_signals]

    callback._max_calls = max_calls

    # Register the callback
    for signal in on_signals:
        receivers[signal].add(callback)

    # Setup responds_to partial for use later
    if not hasattr(callback, 'responds_to'):
        callback.responds_to = partial(responds_to, callback)

    # Setup signals partial for use later.
    if not hasattr(callback, 'signals'):
        callback.signals = partial(signals, callback)

    # Setup disconnect partial for user later
    if not hasattr(callback, 'disconnect'):
        callback.disconnect = partial(disconnect, callback)

    # Setup disconnect_from partial for user later
    if not hasattr(callback, 'disconnect_from'):
        callback.disconnect_from = partial(disconnect_from, callback)

    return callback