
    {Ti                     B    d Z ddlmZ ddlmZ ddlmZ  G d de      Zy)z)Custom indexing for Bio.SearchIO objects.    )StringIO)_IndexedSeqFileProxy)_open_for_random_accessc                   "    e Zd ZdZd Zd Zd Zy)SearchIndexerzBase class for file format specific random access.

    Subclasses for each file format should define '_parser' and optionally
    'get_raw' methods.
    c                 2    t        |      | _        || _        y)zInitialize the class.N)r   _handle_kwargs)selffilenamekwargss      F/home/agent/.local/lib/python3.12/site-packages/Bio/SearchIO/_index.py__init__zSearchIndexer.__init__   s    .x8    c           	      `    t        t         | j                  |fi | j                              S )z9Pass handle and arguments to the next iterable (PRIVATE).)nextiter_parserr
   )r   handles     r   _parsezSearchIndexer._parse   s&    Df==>??r   c                 p    | j                  t        | j                  |      j                                     S )z/Get offset and convert it from bytes to string.)r   r   get_rawdecode)r   offsets     r   getzSearchIndexer.get!   s(    {{8DLL$8$?$?$ABCCr   N)__name__
__module____qualname____doc__r   r   r    r   r   r   r      s    
@Dr   r   N)r   ior   Bio.Filer   r   r   r    r   r   <module>r#      s"    0  ) ,D( Dr   