code: def _bool_to_indices(indices, len_):
      true_indices = []
      for i, index in enumerate(indices):
          if isinstance(index, (bool, np.bool_)):
              if index:
                  true_indices.append(i)
          else:
              return indices
  
      if not len(indices) == len_:
          raise ValueError(
              "The number of booleans is different from the length of dataset"
          )
      return true_indices
  
imports: import numbers
  import numpy
  import six
  import chainer
label_desc: Use image node_id 3 for calling a global function with example usage: _bool_to_indices(indices, len_) and returns: true_indices, indices