docstr: Verify the files and folder are correct on the remote machine
  
  :param remote: paramiko.SSHClient
  :param overwrite: whether to overwrite existing script file and folder
  :return: whether the files are set correctly
  :rtype: bool
code: def verify_remote(self, remote, overwrite=False):  # pragma: no cover
      """
      Verify the files and folder are correct on the remote machine
  
      :param remote: paramiko.SSHClient
      :param overwrite: whether to overwrite existing script file and folder
      :return: whether the files are set correctly
      :rtype: bool
      """
  
      sftp = open_sftp_with_timeout(remote.client, 5)
      local_script = self.script.split()[0]
      local_job_path = os.path.join(
          os.path.dirname(local_script), "jobs"
      )
      if not os.path.isdir(local_job_path):
          logger.warning(
              "Create missing local job config directory %s",
              local_job_path,
          )
          os.makedirs(local_job_path)
      remote_script = os.path.join(
          self.path, os.path.basename(self.script)
      )
      try:
          sftp.stat(self.path)
      except FileNotFoundError:
          logger.warning("Create missing folder %s", self.path)
          sftp.mkdir(self.path)
      try:
          path = os.path.join(self.path, "jobs")
          stats = sftp.stat(path)
          if not (stats.st_mode & stat.S_IWRITE):
              logger.warning("%s/jobs is not writable, changed", path)
              sftp.chmod(path, stat.S_IWRITE)
      except FileNotFoundError:
          logger.warning(
              "create jobs %s", os.path.join(self.path, "jobs")
          )
          sftp.mkdir(os.path.join(self.path, "jobs"))
  
      if overwrite:
          logger.info("Overwrite script %s", remote_script)
          sftp.put(local_script, remote_script)
          sftp.chmod(remote_script, stat.S_IRWXU)
      try:
          sftp.stat(remote_script)
      except FileNotFoundError:
          logger.warning("script not found, copy local file over")
          sftp.put(local_script, remote_script)
          sftp.chmod(remote_script, stat.S_IRWXU)
  
      stats = sftp.stat(remote_script)
      if not (stats.st_mode & stat.S_IEXEC):
          logger.warning("Assign correct permission")
          sftp.chmod(remote_script, stat.S_IRWXU)
      sftp.close()
      return True
  
file_path: auptimizer/src/aup/EE/Job.py
imports: import logging
  import os
  import stat
  from time import sleep
  from ..utils import open_sftp_with_timeout
label_desc: Use image node_id 3 for calling the Job obj's underlying member method code with example usage: obj.verify_remote(remote, overwrite) and returns: True