docs: def method_file_check(f):
      """
      A decorator to check that a TFile as been created before f is called.
      This function can decorate methods.
  
      This requires special treatment since in Python 3 unbound methods are
      just functions: http://stackoverflow.com/a/3589335/1002176 but to get
      consistent access to the class in both 2.x and 3.x, we need self.
      """
      @wraps(f)
      def wrapper(self, *args, **kwargs):
          curr_dir = ROOT.gDirectory
          if isinstance(curr_dir, ROOT.TROOT) or not curr_dir:
              raise RuntimeError(
                  "You must first create a File before calling {0}.{1}".format(
                      self.__class__.__name__, _get_qualified_name(f)))
          if not curr_dir.IsWritable():
              raise RuntimeError(
                  "Calling {0}.{1} requires that the "
                  "current File is writable".format(
                      self.__class__.__name__, _get_qualified_name(f)))
          return f(self, *args, **kwargs)
      return wrapper