code: def __getitem__(self, elem: Elem):
      i, j = elem
  
      start = self.column_ranges[i * 2 + 0]
      end = self.column_ranges[i * 2 + 1]
      if start <= j < end:
          return self.dense[self.offsets[i] + j - start]
      return np.inf
  
imports: import array
  from abc import ABC, abstractmethod
  from itertools import repeat
  from typing import Tuple
  import numpy
  from .window import CRWindow, Window
label_desc: Use image node_id 4 for calling the SparseCostMatrix obj's underlying member method code with example usage: obj.__getitem__(elem) and returns: np, self