code: def remove_remote_directory(sftp, directory):
      """remove a directory in remote machine"""
      try:
          files = sftp.listdir(directory)
          for file in files:
              filepath = "/".join([directory, file])
              try:
                  sftp.remove(filepath)
              except IOError:
                  remove_remote_directory(sftp, filepath)
          sftp.rmdir(directory)
      except IOError as err:
          print_error(err)
  
imports: import os
  from .common_utils import print_error
  from .command_utils import install_package_command
label_desc: Use image node_id 4 for calling a global function with example usage: remove_remote_directory(sftp, directory) without return types