

def gzip_aware_open(fname):
    if (fname == '-'):
        f = sys.stdin
    elif ((fname[(- 3):] == '.gz') or (fname[(- 4):] == '.bgz')):
        f = gzip.open(os.path.expanduser(f))
    else:
        f = open(os.path.expanduser(fname))
    return f

dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/support/ngs_utils.py gzip_aware_open/VarMisuse@69/81 `fname`->`f`