human
Complete this python program:
def _format_callbacks(cb):
assistant
#Here is the Python code you requested.

    """helper function for Future.__repr__
    """
    size = len(cb)
    if (not size):
        cb = ''
    def format_cb(callback):
        return events._format_callback_source(callback, ())
    if (size == 1):
        cb = format_cb(cb[0])
    elif (size == 2):
        cb = '{},    {}'.format(format_cb(cb[0]), format_cb(cb[1]))
    elif (size > 2):
        cb = '{},    <{}    more>,    {}'.format(format_cb(cb[0]), (size - 2), format_cb(cb[(-1)]))
    return ('cb=[%s]' % cb)