docs: def root_open(filename, mode=''):
      """
      Open a ROOT file via ROOT's static ROOT.TFile.Open [1] function and return
      an asrootpy'd File.
  
      Parameters
      ----------
  
      filename : string
          The absolute or relative path to the ROOT file.
  
      mode : string, optional (default='')
          Mode indicating how the file is to be opened.  This can be either one
          of the options supported by ROOT.TFile.Open [2], or one of `a`, `a+`,
          `r`, `r+`, `w` or `w+`, with meanings as for the built-in `open()`
          function [3].
  
      Returns
      -------
  
      root_file : File
          an instance of rootpy's File subclass of ROOT's TFile.
  
      References
      ----------
  
      .. [1] http://root.cern.ch/root/html/TFile.html#TFile:Open
      .. [2] http://root.cern.ch/root/html/TFile.html#TFile:TFile@2
      .. [3] https://docs.python.org/2/library/functions.html#open
  
      """
      mode_map = {'a': 'UPDATE',
                  'a+': 'UPDATE',
                  'r': 'READ',
                  'r+': 'UPDATE',
                  'w': 'RECREATE',
                  'w+': 'RECREATE'}
  
      if mode in mode_map:
          mode = mode_map[mode]
  
      filename = expand_path(filename)
      prev_dir = ROOT.gDirectory
      root_file = ROOT.R.TFile.Open(filename, mode)
      if not root_file:
          raise IOError("could not open file: '{0}'".format(filename))
      root_file.__class__ = File
      root_file._path = filename
      root_file._parent = root_file
      root_file._prev_dir = prev_dir
      # give Python ownership of the TFile so we can delete it
      ROOT.SetOwnership(root_file, True)
      return root_file