code: def upload(self, local_fn, remote_fn=None, dont_overwrite=False):
      
  
      # support wildcard through glob
      if '*' in local_fn:
        for local_subfn in glob.glob(local_fn):
          self.upload(local_subfn)
        return
  
      if remote_fn is None:
        remote_fn = os.path.basename(local_fn)
  
      if dont_overwrite and self.exists(remote_fn):
        self.log("Remote file %s exists, skipping" % (remote_fn,))
        return
  
      if not remote_fn.startswith('/'):
        remote_fn = self.taskdir + '/' + remote_fn
  
      remote_fn = remote_fn.replace('~', self.homedir)
      self.log('uploading ' + local_fn + ' to ' + remote_fn)
  
      local_fn = os.path.abspath(local_fn)
      self._run_raw("cp -R %s %s" % (local_fn, remote_fn))
docs: Uploads file to remote instance. If location not specified, dumps it
      into default directory. Creates missing directories in path name.