code: def open_file(filename):
      """Open file."""
      if filename.endswith(".gz"):
          fp = gzip.open(filename, "rt")
      else:
          fp = open(filename)
      yield fp
      fp.close()
  
imports: import csv
  from collections import namedtuple
  from contextlib import contextmanager
  import gzip
  import numpy
  from ..utils import pad_batch_data
  from ..utils.args import str2bool
  from ..utils.masking import mask
  from ..utils import tokenization
label_desc: Use image node_id 1 for calling a global function with example usage: open_file(filename) without return types