def upload(remote_location, remotes=None, ignores=None,<EOL>static_root="<STR_LIT>", prefix="<STR_LIT>", dry_run=False):<EOL>
if remotes is None:<EOL><INDENT>remotes, ignores = _resources_files(<EOL>abs_paths=remote_location.startswith('<STR_LIT>'))<EOL><DEDENT>if remote_location.startswith('<STR_LIT>'):<EOL><INDENT>from deployutils.s3 import S3Backend<EOL>backend = S3Backend(remote_location,<EOL>static_root=static_root, dry_run=dry_run)<EOL>backend.upload(list_local(remotes, prefix), prefix)<EOL><DEDENT>else:<EOL><INDENT>excludes = []<EOL>if ignores:<EOL><INDENT>for ignore in ignores:<EOL><INDENT>excludes += ['<STR_LIT>', ignore]<EOL><DEDENT><DEDENT>shell_command(['<STR_LIT>']<EOL>+ excludes + ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>+ remotes + [remote_location], dry_run=dry_run)<EOL><DEDENT>
Upload resources to a stage server.