code: def _open(fname, mode, encoding):
      if fname.endswith(".gz"):
          import gzip
  
          return gzip.open(fname, mode, encoding=encoding)
      else:
          return open(fname, mode, encoding=encoding)
  
file_path: statsmodels/statsmodels/iolib/openfile.py
imports: from pathlib import Path
  from numpy.lib._iotools import _is_string_like
label_desc: Use image node_id 1 for calling a global function with example usage: _open(fname, mode, encoding) and returns: gzip, open