code: def dump(obj, root_file, proto=0, key=None):
      
      if isinstance(root_file, string_types):
          root_file = root_open(root_file, 'recreate')
          own_file = True
      else:
          own_file = False
      ret = Pickler(root_file, proto).dump(obj, key)
      if own_file:
          root_file.Close()
      return ret
docs: Dump an object into a ROOT TFile.
  
      `root_file` may be an open ROOT file or directory, or a string path to an
      existing ROOT file.