code: def openfile(fname):
      """
      Opens the file handle of file `fname`.
  
      """
      # A file handle
      if hasattr(fname, "readline"):
          return fname
      # Try to open the file and guess its type
      try:
          f = open(fname)
      except IOError:
          raise IOError("No such file: '%s'" % fname)
      if f.readline()[:2] != "\\x":
          f.seek(0, 0)
          return f
      f.close()
      raise NotImplementedError("Wow, binary file")
  
imports: from __future__ import division, absolute_import, print_function
  import sys
  import warnings
  import numpy
  import numpy.core.numerictypes
  from numpy.compat import basestring
  from numpy import bool_, dtype, ndarray, recarray, array
  from numpy.core.records import fromarrays, fromrecords
  import numpy.ma
  from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array, getdata, getmaskarray, filled
label_desc: Use image node_id 7 for calling a global function with example usage: openfile(fname) and returns: fname, f