code: def create_version_with_frames(
      new_frames, ds_name, ver_name, local_dataset_path
  ):
      """
      Create a DatasetVersion with new_frames as frames
  
      :param new_frames: list with all the frames to be registered
      :type new_frames: List[SingleFrame]
      :param ds_name: The dataset name
      :type ds_name: str
      :param ver_name: The version name
      :type ver_name: str
      :param local_dataset_path: Path to the folder you register
      :param local_dataset_path: str
      """
      # Get the dataset (it will create a new one if we don't have it)
      ds = DatasetVersion.create_new_dataset(dataset_name=ds_name)
  
      # create a specific dataset version, or just use the latest version
      dv = (
          ds.create_version(version_name=ver_name)
          if ver_name
          else DatasetVersion.get_current(dataset_name=ds_name)
      )
  
      # Add and upload frames to created version
      dv.add_frames(
          new_frames,
          # where to upload the files, we will use for example the default one, you can also s3://bucket/ etc
          auto_upload_destination=Task.current_task().get_output_destination(),
          # The local root, this will make sure we keep the same
          # files structure in the upload destination as we have on the local machine
          local_dataset_root_path=local_dataset_path,
      )
      dv.commit_version()
  
file_path: clearml/examples/hyperdatasets/data-registration/register_dataset_with_roi.py
imports: import glob
  import json
  import os
  from allegroai import DatasetVersion, SingleFrame, Task
  from argparse import ArgumentParser
  from clearml import StorageManager
label_desc: Use image node_id 3 for calling a global function with example usage: create_version_with_frames(new_frames, ds_name, ver_name, local_dataset_path) without return types