class_docstr: Handle decompression of a compressed data file.
  
  Constructor
  -----------
  
  cache_size : int
      Maximum number of chunks to keep in memory while reading. Every chunk kept in cache
      may take a few dozens of MB in RAM.
  check_after_decompress : bool
      Whether to perform the automatic check after decompression.
class_docstr_tok: ["Handle","decompression","of","a","compressed","data","file",".","Constructor","--","--","--","--","--","-","cache_size",":","int","Maximum","number","of","chunks","to","keep","in","memory","while","reading",".","Every","chunk","kept","in","cache","may","take","a","few","dozens","of","MB","in","RAM",".","check_after_decompress",":","bool","Whether","to","perform","the","automatic","check","after","decompression","."]
docstr: Implement NumPy array slicing, return a regular in-memory NumPy array.
docstr_tok: ["Implement","NumPy","array","slicing",",","return","a","regular","in-memory","NumPy","array","."]
code: def __getitem__(self, item):
      """Implement NumPy array slicing, return a regular in-memory NumPy array."""
      fallback = np.zeros((0, self.n_channels), dtype=self.dtype)
      if isinstance(item, slice):
          # Slice indexing.
          i0 = self._validate_index(item.start, 0)
          i1 = self._validate_index(item.stop, self.n_samples)
          if i1 <= i0:
              return fallback
          assert i0 < i1
          first_chunk, last_chunk = self._chunks_for_interval(i0, i1)
          chunks = []
          for chunk_idx, chunk_start, chunk_length in self.iter_chunks(
              first_chunk, last_chunk
          ):
              chunk = self.read_chunk(
                  chunk_idx, chunk_start, chunk_length
              )
              chunks.append(chunk)
          if not chunks:  # pragma: no cover
              return fallback
          if first_chunk < last_chunk:
              # Concatenate all chunks.
              ns = sum(chunk.shape[0] for chunk in chunks)
              arr = np.empty((ns, self.n_channels), dtype=self.dtype)
              arr = np.concatenate(chunks, out=arr)
          else:
              assert len(chunks) == 1
              arr = chunks[0]
          assert arr.ndim == 2
          assert arr.shape[1] == self.n_channels
          assert arr.shape[0] == (
              self.chunk_bounds[last_chunk + 1]
              - self.chunk_bounds[first_chunk]
          )
          # Subselect in the chunk.
          a = i0 - self.chunk_bounds[first_chunk]
          b = i1 - self.chunk_bounds[first_chunk]
          assert 0 <= a <= b <= arr.shape[0]
          out = arr[a : b : item.step, :]
          # Ensure the shape of the output is the expected shape from the slice length.
          assert out.shape[0] == len(range(i0, i1, item.step or 1))
          return out
      elif isinstance(item, tuple):
          # Multidimensional indexing.
          if len(item) == 1:
              return self[item[0]]
          elif len(item) == 2 and np.isscalar(item[0]):
              return self[item[0]][item[1]]
          elif len(item) == 2:
              return self[item[0]][:, item[1]]
      elif isinstance(item, int):
          if item < 0:
              # Deal with negative indices.
              k = -int(np.floor(item / self.n_samples))
              item = item + self.n_samples * k
              assert 0 <= item < self.n_samples
          if not 0 <= item < self.n_samples:  # pragma: no cover
              raise IndexError(
                  "index %d is out of bounds for axis 0 with size %d"
                  % (item, self.n_samples)
              )
          out = self[item : item + 1]
          return out[0]
      elif isinstance(item, (list, np.ndarray)):  # pragma: no cover
          raise NotImplementedError(
              "Indexing with multiple values is currently unsupported."
          )
      return fallback
  
imports: import argparse
  import bisect
  from functools import lru_cache
  import hashlib
  import json
  import logging
  import multiprocessing
  from multiprocessing.dummy import Pool
  import os
  import os.path
  from pathlib import Path
  import sys
  from threading import Lock
  import zlib
  from tqdm import tqdm
  import numpy
label_desc: Use image node_id 15 for calling the Reader obj's underlying member method code with example usage: obj.__getitem__(item) and returns: fallback, out, fallback, fallback, self, out, self, self