code: def main():
      if args.buckets_num > 1:
          bucket_length = (
              args.max_duration - args.min_duration
          ) / float(args.buckets_num)
          for i in range(args.buckets_num):
              min_duration = args.min_duration + i * bucket_length
              max_duration = min_duration + bucket_length
              if i == args.buckets_num - 1:
                  # add a small number to cover the samples with exactly duration of max_duration in the last bucket.
                  max_duration += 1e-5
              target_dir = os.path.join(args.target_dir, f"bucket{i+1}")
              print(
                  f"Creating bucket {i+1} with min_duration={min_duration} and max_duration={max_duration} ..."
              )
              print(f"Results are being saved at: {target_dir}.")
              create_tar_datasets(
                  min_duration=min_duration,
                  max_duration=max_duration,
                  target_dir=target_dir,
              )
              print(f"Bucket {i+1} is created.")
      else:
          create_tar_datasets(
              min_duration=args.min_duration,
              max_duration=args.max_duration,
              target_dir=args.target_dir,
          )
  
imports: import argparse
  import copy
  import json
  import os
  import random
  import tarfile
  from collections import defaultdict
  from dataclasses import dataclass, field
  from datetime import datetime
  from io import BytesIO
  from typing import Any, List, Optional
  import numpy
  import soundfile
  from joblib import Parallel, delayed
  from omegaconf import DictConfig, OmegaConf, open_dict
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types