parameters: (self, start, end, start_block_number, end_block_number)
docstring: Read from our block cache.
  
          Parameters
          ----------
          start, end : int
              The start and end byte positions.
          start_block_number, end_block_number : int
              The start and end block numbers.
docstring_summary: Read from our block cache.
docstring_tokens: Read from our block cache .
function: def _read_cache(self, start, end, start_block_number, end_block_number):
          """
          Read from our block cache.
  
          Parameters
          ----------
          start, end : int
              The start and end byte positions.
          start_block_number, end_block_number : int
              The start and end block numbers.
          """
          start_pos = start % self.blocksize
          end_pos = end % self.blocksize
  
          if start_block_number == end_block_number:
              block = self._fetch_block_cached(start_block_number)
              return block[start_pos:end_pos]
  
          else:
              # read from the initial
              out = []
              out.append(self._fetch_block_cached(start_block_number)[start_pos:])
  
              # intermediate blocks
              # Note: it'd be nice to combine these into one big request. However
              # that doesn't play nicely with our LRU cache.
              for block_number in range(start_block_number + 1, end_block_number):
                  out.append(self._fetch_block_cached(block_number))
  
              # final block
              out.append(self._fetch_block_cached(end_block_number)[:end_pos])
  
              return b"".join(out)
function_tokens: def _read_cache ( self , start , end , start_block_number , end_block_number ) : start_pos = start % self . blocksize end_pos = end % self . blocksize if start_block_number == end_block_number : block = self . _fetch_block_cached ( start_block_number ) return block [ start_pos : end_pos ] else : # read from the initial out = [ ] out . append ( self . _fetch_block_cached ( start_block_number ) [ start_pos : ] ) # intermediate blocks # Note: it'd be nice to combine these into one big request. However # that doesn't play nicely with our LRU cache. for block_number in range ( start_block_number + 1 , end_block_number ) : out . append ( self . _fetch_block_cached ( block_number ) ) # final block out . append ( self . _fetch_block_cached ( end_block_number ) [ : end_pos ] ) return b"" . join ( out )