code: def readConfigFile(fname, **scope):
      # cwd = os.getcwd()
      global GLOBAL_PATH
      if GLOBAL_PATH is not None:
          fname2 = os.path.join(GLOBAL_PATH, fname)
          if os.path.exists(fname2):
              fname = fname2
  
      GLOBAL_PATH = os.path.dirname(os.path.abspath(fname))
  
      local = {**scope, **units.allUnits}
      local["OrderedDict"] = OrderedDict
      local["readConfigFile"] = readConfigFile
      local["Point"] = Point
      local["QtCore"] = QtCore
      local["ColorMap"] = ColorMap
      local["datetime"] = datetime
      # Needed for reconstructing numpy arrays
      local["array"] = numpy.array
      for dtype in [
          "int8",
          "uint8",
          "int16",
          "uint16",
          "float16",
          "int32",
          "uint32",
          "float32",
          "int64",
          "uint64",
          "float64",
      ]:
          local[dtype] = getattr(numpy, dtype)
  
      try:
          # os.chdir(newDir)  ## bad.
          with open(fname, "rt") as fd:
              s = fd.read()
          s = s.replace("\r\n", "\n")
          s = s.replace("\r", "\n")
          data = parseString(s, **local)[1]
      except ParseError:
          sys.exc_info()[1].fileName = fname
          raise
      except:
          print("Error while reading config file %s:" % fname)
          raise
      # finally:
      # os.chdir(cwd)
      return data
  
file_path: pyqtgraph/pyqtgraph/configfile.py
imports: import datetime
  import os
  import re
  import sys
  from collections import OrderedDict
  import numpy
  from .None import units
  from .colormap import ColorMap
  from .Point import Point
  from .Qt import QtCore
label_desc: Use image node_id 2 for calling a global function with example usage: readConfigFile(fname) and returns: data