<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_callbacks(callbacks):
 """Encode callbacks to as a dict suitable for JSON encoding."""

    from furious.async import Async

    if not callbacks:
        return

    encoded_callbacks = {}
    for event, callback in callbacks.iteritems():
        if callable(callback):
            callback, _ = get_function_path_and_options(callback)

        elif isinstance(callback, Async):
            callback = callback.to_dict()

        encoded_callbacks[event] = callback

    return encoded_callbacks