code: def pickle_all(self, path):
          
          all_search_methods = [(name, self.__getattribute__(name)) for name in
                                dir(self) if name[0].isupper()]
          # all_search_methods = [("Account", self.__getattribute__("Account")), ("Package", self.__getattribute__("Package"))]
          all_objects = {}
          for method in all_search_methods:
              result = method[1]()
              if isinstance(result, JSSFlatObject):
                  all_objects[method[0]] = result
              else:
                  try:
                      all_objects[method[0]] = result.retrieve_all()
                  except JSSGetError:
                      # A failure to get means the object type has zero
                      # results.
                      print method[0], " has no results! (GETERRROR)"
                      all_objects[method[0]] = []
          # all_objects = {method[0]: method[1]().retrieve_all()
          #                for method in all_search_methods}
          with open(os.path.expanduser(path), "wb") as pickle:
              cPickle.Pickler(pickle, cPickle.HIGHEST_PROTOCOL).dump(all_objects)
docs: Back up entire JSS to a Python Pickle.
  
          For each object type, retrieve all objects, and then pickle
          the entire smorgasbord. This will almost certainly take a long
          time!
  
          Pickling is Python's method for serializing/deserializing
          Python objects. This allows you to save a fully functional
          JSSObject to disk, and then load it later, without having to
          retrieve it from the JSS.
  
          Args:
              path: String file path to the file you wish to (over)write.
                  Path will have ~ expanded prior to opening.