(self, n)
return self.cache[min(max(0, value_index), self.steps)]
Read an item from the cache.
Read an item from the cache.
Read an item from the cache .
def __getitem__(self, n):
        """Read an item from the cache."""
        if self.background is not None and not n:
            return self.background
            
        value_index = int(round((n - self.min) / self._step_size))
        
        if self.loop:
            if value_index != self.steps:
                return self.cache[value_index % self.steps]
        return self.cache[min(max(0, value_index), self.steps)]
def __getitem__ ( self , n ) : if self . background is not None and not n : return self . background value_index = int ( round ( ( n - self . min ) / self . _step_size ) ) if self . loop : if value_index != self . steps : return self . cache [ value_index % self . steps ] return self . cache [ min ( max ( 0 , value_index ) , self . steps ) ]