class_docstr: TODO(klausg): documentation.
class_docstr_tok: ["TODO","(","klausg",")",":","documentation","."]
code: def fetch(self, asset_path, asset_id):
      local_path = self.local_dir / (asset_id + ".tar.gz")
      if not local_path.exists():
          logging.debug(
              "Copying %s to %s", str(asset_path), str(local_path)
          )
          local_path.parent.mkdir(parents=True, exist_ok=True)
          tf.io.gfile.copy(asset_path, local_path)
  
          with tarfile.open(local_path, "r:gz") as tar:
              # We support two kinds of archives:
              #  1. flat archives that do not contain any directories
              #  2. archives where the content is in a directory with the name of the asset
              list_of_files = tar.getnames()
              if (
                  asset_id in list_of_files
                  and tar.getmember(asset_id).isdir()
              ):
                  # tarfile contains directory with name object_id, so we can just extract
                  assert (
                      f"{asset_id}/data.json" in list_of_files
                  ), list_of_files
                  tar.extractall(self.local_dir)
              else:
                  # tarfile contains files only, so extract into a new directory
                  assert "data.json" in list_of_files, list_of_files
                  tar.extractall(self.local_dir / asset_id)
              logging.debug(
                  "Extracted %s",
                  repr([m.name for m in tar.getmembers()]),
              )
  
      return self.local_dir / asset_id
  
imports: import difflib
  import functools
  import logging
  import pathlib
  import shutil
  import tarfile
  import tempfile
  import numpy
  import tensorflow
  from typing import Optional, Dict, Any, Type
  import weakref
  from kubric import core
  from kubric import file_io
  from kubric.kubric_typing import PathLike
label_desc: Use image node_id 13 for calling the AssetSource obj's underlying member method code with example usage: obj.fetch(asset_path, asset_id) and returns: unknown