code: def copy_tree(src, dst, update=False):
      if not os.path.exists(dst):
          os.makedirs(dst)
      for item in os.listdir(src):
          s = os.path.join(src, item)
          d = os.path.join(dst, item)
          if os.path.isdir(s):
              copy_tree(s, d, update)
          else:
              if (
                  update
                  and os.path.exists(d)
                  and os.path.getmtime(s) <= os.path.getmtime(d)
              ):
                  continue
              shutil.copy2(s, d)
  
file_path: metaflow/metaflow/metadata/util.py
imports: from io import BytesIO
  import os
  import shutil
  import tarfile
  from metaflow import util
  from metaflow.plugins.datastores.local_storage import LocalStorage
label_desc: Use image node_id 1 for calling a global function with example usage: copy_tree(src, dst, update) without return types