code: def _check_ssh(self, *args):
          
          ssh = subprocess.Popen(
              args,
              stdin=subprocess.DEVNULL,
              stdout=subprocess.DEVNULL,
              stderr=subprocess.DEVNULL)
          ssh.wait()
          return ssh.returncode == 0
docs: Check if SSH connection can be made to IP with username.