code: def test_crop_dataset_by_bounding_boxes_and_save(self):
      dataset = LightlyDataset(self.cfg.input_dir)
      output_dir = self.cfg.output_dir
      no_files = len(dataset.get_filenames())
      bounding_boxes_list_list = [[BoundingBox(0, 0, 1, 1)]] * no_files
      class_indices_list_list = [[1]] * no_files
      class_names = ["class_0", "class_1"]
      with self.subTest("all_correct"):
          crop_dataset_by_bounding_boxes_and_save(
              dataset,
              output_dir,
              bounding_boxes_list_list,
              class_indices_list_list,
              class_names,
          )
      with self.subTest("wrong length of bounding_boxes_list_list"):
          with self.assertRaises(ValueError):
              crop_dataset_by_bounding_boxes_and_save(
                  dataset,
                  output_dir,
                  bounding_boxes_list_list[:-1],
                  class_indices_list_list,
                  class_names,
              )
      with self.subTest(
          "wrong internal length of class_indices_list_list"
      ):
          with self.assertWarns(UserWarning):
              class_indices_list_list[0] *= 2
              crop_dataset_by_bounding_boxes_and_save(
                  dataset,
                  output_dir,
                  bounding_boxes_list_list,
                  class_indices_list_list,
                  class_names,
              )
  
imports: import os
  import random
  import re
  import sys
  import tempfile
  import torchvision
  import yaml
  from hydra.experimental import compose, initialize
  import lightly
  from lightly.data import LightlyDataset
  from lightly.utils.bounding_box import BoundingBox
  from lightly.utils.cropping.crop_image_by_bounding_boxes import crop_dataset_by_bounding_boxes_and_save
  from lightly.utils.cropping.read_yolo_label_file import read_yolo_label_file
  from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowClient, MockedApiWorkflowSetup
label_desc: Use image node_id 7 for calling the TestCLICrop obj's underlying member method code with example usage: obj.test_crop_dataset_by_bounding_boxes_and_save() without return types