code: def copy_from_local(localpath, remotepath, is_dir=False):
      if is_dir:
          if not os.path.exists(remotepath):
              # remote folder does not exist
              shutil.copytree(localpath, remotepath)
          else:
              # remote folder exists, copy each file
              src_files = os.listdir(localpath)
              for file_name in src_files:
                  full_file_name = os.path.join(localpath, file_name)
                  if os.path.isdir(full_file_name):
                      # copy folder recursively
                      full_remote_path = os.path.join(
                          remotepath, file_name
                      )
                      shutil.copytree(full_file_name, full_remote_path)
                  else:
                      # copy each file
                      shutil.copy(full_file_name, remotepath)
      else:
          shutil.copy(localpath, remotepath)
  
file_path: TabPy/tabpy/tabpy_server/handlers/management_handler.py
imports: import logging
  import os
  import shutil
  from re import compile
  from uuid import uuid4
  from tornado import gen
  from tabpy.tabpy_server.app.app_parameters import SettingsParameters
  from tabpy.tabpy_server.handlers import BaseHandler
  from tabpy.tabpy_server.handlers.base_handler import STAGING_THREAD
  from tabpy.tabpy_server.management.state import get_query_object_path
  from tabpy.tabpy_server.psws.callbacks import on_state_change
label_desc: Use image node_id 1 for calling a global function with example usage: copy_from_local(localpath, remotepath, is_dir) without return types