<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload_hub(hub, host, remote_dir, user=None, port=22, rsync_options=RSYNC_OPTIONS, staging=None):
 """ Renders, stages, and uploads a hub. """

    hub.render()
    if staging is None:
        staging = tempfile.mkdtemp()
    staging, linknames = stage_hub(hub, staging=staging)
    local_dir = os.path.join(staging)
    upload(host, user, local_dir=local_dir, remote_dir=remote_dir, rsync_options=rsync_options)
    return linknames