class_docstr: A torch Dataset whose __getitem__ returns both a batch of activation vectors,
  as well as a batch of labels associated with those activation vectors.
  It is used to train a classifier in train_tcav
class_docstr_tok: ["A","torch","Dataset","whose","__getitem__","returns","both","a","batch","of","activation","vectors",",","as","well","as","a","batch","of","labels","associated","with","those","activation","vectors",".","It","is","used","to","train","a","classifier","in","train_tcav"]
code: def _i_to_k(self, i):
      left, right = 0, len(self.uppers)
      while left < right:
          mid = (left + right) // 2
          if self.lowers[mid] <= i and i < self.uppers[mid]:
              return mid
          if i >= self.uppers[mid]:
              left = mid
          else:
              right = mid
  
imports: from collections import defaultdict
  from typing import Any, cast, Dict, List, Set, Tuple, Union
  import numpy
  import torch
  import torch.multiprocessing
  from captum._utils.av import AV
  from captum._utils.common import _format_tensor_into_tuples, _get_module_from_name
  from captum._utils.typing import TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr import LayerActivation, LayerAttribution, LayerGradientXActivation
  from captum.concept._core.cav import CAV
  from captum.concept._core.concept import Concept, ConceptInterpreter
  from captum.concept._utils.classifier import Classifier, DefaultClassifier
  from captum.concept._utils.common import concepts_to_str
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 2 for calling the LabelledDataset obj's underlying member method code with example usage: obj._i_to_k(i) and returns: mid