code: def generate_octomap_samples(octomap_file, query_positions, tmp_dir):
      if not os.path.exists(tmp_dir):
          os.makedirs(tmp_dir)
  
      tmp_query_positions_hdf5_file = os.path.join(
          tmp_dir, "_tmp_query_positions.hdf5"
      )
      tmp_octomap_samples_hdf5_file = os.path.join(
          tmp_dir, "_tmp_octomap_samples.hdf5"
      )
  
      with h5py.File(tmp_query_positions_hdf5_file, "w") as f:
          f.create_dataset("dataset", data=query_positions)
  
      current_source_path = path_utils.get_current_source_file_path(
          frame=inspect.currentframe()
      )
      cpp_bin = os.path.abspath(
          os.path.join(
              current_source_path,
              "..",
              "..",
              "cpp",
              "bin",
              "generate_octomap_samples",
          )
      )
  
      cmd = (
          cpp_bin
          + " --octomap_file="
          + octomap_file
          + " --query_positions_file="
          + tmp_query_positions_hdf5_file
          + " --output_file="
          + tmp_octomap_samples_hdf5_file
          + " --silent"
      )
      # print("")
      # print(cmd)
      # print("")
      retval = os.system(cmd)
      assert retval == 0
  
      with h5py.File(tmp_octomap_samples_hdf5_file, "r") as f:
          octomap_samples = matrix(f["dataset"][:]).A1
  
      return octomap_samples
  
file_path: ml-hypersim/code/python/lib/octomap_utils.py
imports: from pylab import *
  import h5py
  import inspect
  import os
  import scipy.spatial
  import path_utils
  import sphere_sampling_utils
label_desc: Use image node_id 2 for calling a global function with example usage: generate_octomap_samples(octomap_file, query_positions, tmp_dir) and returns: octomap_samples