parameters: (self, filename, read_location, read_size,
                         read_masked_crc32c)
docstring: Read data from the file ``filename`` from a given offset
          ``read_location`` and size ``read_size``. Data is validated with the provided
          ``masked_crc32c``. This is thread safe and manages a list of open files.
docstring_summary: Read data from the file ``filename`` from a given offset
          ``read_location`` and size ``read_size``. Data is validated with the provided
          ``masked_crc32c``. This is thread safe and manages a list of open files.
docstring_tokens: Read data from the file filename from a given offset read_location and size read_size . Data is validated with the provided masked_crc32c . This is thread safe and manages a list of open files .
function: def read_from_file(self, filename, read_location, read_size,
                         read_masked_crc32c):
          """Read data from the file ``filename`` from a given offset
          ``read_location`` and size ``read_size``. Data is validated with the provided
          ``masked_crc32c``. This is thread safe and manages a list of open files.
          """
          with self._file_handles_lock:
              if filename not in self._file_handles:
                  self._file_handles[filename] = (_fileopen(filename, "rb"),
                                                  threading.Lock())
                  if not self._file_handles[filename][0].seekable():
                      raise RuntimeError(filename + " does not support seeking."
                                         " This storage is not supported.")
              # lock to seek + read
              file_handle = self._file_handles[filename]
              file_handle[1].acquire()
  
          file_handle[0].seek(read_location)
          buf = file_handle[0].read(read_size)
          file_handle[1].release()
          if masked_crc32c(buf) == read_masked_crc32c:
              return buf
          else:
              return None
function_tokens: def read_from_file ( self , filename , read_location , read_size , read_masked_crc32c ) : with self . _file_handles_lock : if filename not in self . _file_handles : self . _file_handles [ filename ] = ( _fileopen ( filename , "rb" ) , threading . Lock ( ) ) if not self . _file_handles [ filename ] [ 0 ] . seekable ( ) : raise RuntimeError ( filename + " does not support seeking." " This storage is not supported." ) # lock to seek + read file_handle = self . _file_handles [ filename ] file_handle [ 1 ] . acquire ( ) file_handle [ 0 ] . seek ( read_location ) buf = file_handle [ 0 ] . read ( read_size ) file_handle [ 1 ] . release ( ) if masked_crc32c ( buf ) == read_masked_crc32c : return buf else : return None