
    5i                     V    d dl mZmZmZ d dlZd dlZd dlZej                  dd       Zy)    )absolute_importdivisionprint_functionNc              +   &  K   ||rdnd}t        | d      r!|rt        j                  | |       y|  yd|v rt        j                  }n|rt        j                  }d|v r	d}nt        } || fd|i|5 }| ddd       y# 1 sw Y   yxY ww)	a  Open a file path, or pass through an already open file handle.

    Args:
        path_or_handle (str or file-like object):
            The file path to open, or an open file-like object with a 'read'
            method.
        mode (str): File open mode, e.g. 'r' or 'w'
        is_gzip (bool): Whether the file is (or should be) gzip-compressed.
        **kwargs (dict): Passed through to `open`

    Returns: file-like object
    Nrbrread)fileobjmodeencodingrtr   )hasattrgzipGzipFilecodecsopen)path_or_handler   is_gzipkwargsopenerfps         x/home/marpiech/ifpan-abm-pgxpred/analysis/marpiech-gwas-test/venv/lib/python3.12/site-packages/dxpy/utils/file_handle.py	as_handler      s      |tC~v&--TBB   [[FYYFd{4DFN888 	BH	 	 	s   A5B7B<	BB
B)NF)	
__future__r   r   r   
contextlibr   r   contextmanagerr        r   <module>r      s1   ( A @       r   