def __init__(self, file, *args, indexable=False, **kwargs):
        """
        :param indexable: if True:
            supported methods seek, tell, object size and subscription, it only works when dealing with a real file
            (the path to the file is specified) because the external grep utility is used, supporting in unix-like OS
            the object behaves like a normal open file
                        if False:
            works like generator converting a record into ReactionContainer and returning each object in order,
            records with errors are skipped
        """
        super().__init__(*args, **kwargs)
        super(CGRread, self).__init__(file)
        self._data = self.__reader()

        if indexable and platform != 'win32' and not self._is_buffer:
            self.__file = iter(self._file.readline, '')
            if next(self._data):
                self._shifts = self._load_cache()
                if self._shifts is None:
                    self._shifts = [int(x.split(b':', 1)[0]) for x in
                                    check_output(['grep', '-boE', r'^\$[RM]FMT', self._file.name]).split()]
                    self._shifts.append(getsize(self._file.name))
                    self._dump_cache(self._shifts)
        else:
            self.__file = self._file
            next(self._data)
def __init__ ( self , file , * args , indexable = False , ** kwargs ) : super ( ) . __init__ ( * args , ** kwargs ) super ( CGRread , self ) . __init__ ( file ) self . _data = self . __reader ( ) if indexable and platform != 'win32' and not self . _is_buffer : self . __file = iter ( self . _file . readline , '' ) if next ( self . _data ) : self . _shifts = self . _load_cache ( ) if self . _shifts is None : self . _shifts = [ int ( x . split ( b':' , 1 ) [ 0 ] ) for x in check_output ( [ 'grep' , '-boE' , r'^\$[RM]FMT' , self . _file . name ] ) . split ( ) ] self . _shifts . append ( getsize ( self . _file . name ) ) self . _dump_cache ( self . _shifts ) else : self . __file = self . _file next ( self . _data )
:param indexable: if True:
            supported methods seek, tell, object size and subscription, it only works when dealing with a real file
            (the path to the file is specified) because the external grep utility is used, supporting in unix-like OS
            the object behaves like a normal open file
                        if False:
            works like generator converting a record into ReactionContainer and returning each object in order,
            records with errors are skipped