code: def _as_indices(indices, len_):
      if isinstance(indices, slice) or len(indices) == 0:
          return indices
  
      if all(isinstance(index, (bool, np.bool_)) for index in indices):
          if not len(indices) == len_:
              raise ValueError(
                  "The number of booleans is "
                  "different from the length of dataset"
              )
          return [i for i, index in enumerate(indices) if index]
      else:
          checked_indices = []
          for index in indices:
              index = int(index)
              if index < 0:
                  index += len_
              if index < 0 or len_ <= index:
                  raise IndexError(
                      "index {} is out of bounds for dataset with size {}".format(
                          index, len_
                      )
                  )
              checked_indices.append(index)
          return checked_indices
  
imports: import numbers
  import numpy
  import six
  from chainer.dataset.tabular import tabular_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: _as_indices(indices, len_) and returns: indices, unknown, checked_indices