code: def _sample_index_from_flatten_index(
      cumsum_lengths, flatten_index
  ) -> int:
      # The cumulative sum lengths is holding the cumulative sum of properties per image, so the first index which value
      # is greater than the flatten index, is the image index.
      # for example if the sums lengths is [1, 6, 11, 13, 16, 20] and the flatten index = 6, it means this property
      # belong to the third image which is index = 2.
      return np.argwhere(cumsum_lengths > flatten_index)[0][0]
  
imports: import string
  import typing
  import warnings
  from abc import abstractmethod
  from collections import defaultdict
  from numbers import Number
  from secrets import choice
  import numpy
  import pandas
  from deepchecks.core import CheckResult, DatasetKind
  from deepchecks.core.errors import DeepchecksProcessError, NotEnoughSamplesError
  from deepchecks.utils.dataframes import hide_index_for_display
  from deepchecks.utils.outliers import iqr_outliers_range
  from deepchecks.utils.strings import format_number
  from deepchecks.vision.base_checks import SingleDatasetCheck
  from deepchecks.vision.context import Context
  from deepchecks.vision.utils.image_functions import draw_image
  from deepchecks.vision.utils.vision_properties import PropertiesInputType
  from deepchecks.vision.vision_data import TaskType, VisionData
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
label_desc: Use image node_id 3 for calling a global function with example usage: _sample_index_from_flatten_index(cumsum_lengths, flatten_index) and returns: np