<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_supervisor_app_conf(app_name, template_name=None, context=None):
 """Upload Supervisor app configuration from a template."""


    default = {'app_name': app_name}
    context = context or {}
    default.update(context)
    template_name = template_name or [u'supervisor/%s.conf' % app_name, u'supervisor/base.conf']
    destination = u'/etc/supervisor/conf.d/%s.conf' % app_name
    upload_template(template_name, destination, context=default, use_sudo=True)
    supervisor_command(u'update')