code: def sync_local_metadata_to_datastore(metadata_local_dir, task_ds):
      with util.TempDir() as td:
          tar_file_path = os.path.join(td, "metadata.tgz")
          buf = BytesIO()
          with tarfile.open(
              name=tar_file_path, mode="w:gz", fileobj=buf
          ) as tar:
              tar.add(metadata_local_dir)
          blob = buf.getvalue()
          _, key = task_ds.parent_datastore.save_data(
              [blob], len_hint=1
          )[0]
          task_ds._dangerous_save_metadata_post_done(
              {"local_metadata": key}
          )
  
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 2 for calling a global function with example usage: sync_local_metadata_to_datastore(metadata_local_dir, task_ds) without return types