class_docstr: Serializable will change the behaviors of pickle.
  
      The rule to tell if a attribute will be kept or dropped when dumping.
      The rule with higher priorities is on the top
      - in the config attribute list -> always dropped
      - in the include attribute list -> always kept
      - in the exclude attribute list -> always dropped
      - name not starts with `_` -> kept
      - name starts with `_` -> kept if `dump_all` is true else dropped
  
  It provides a syntactic sugar for distinguish the attributes which user doesn't want.
  - For examples, a learnable Datahandler just wants to save the parameters without data when dumping to disk
class_docstr_tok: ["Serializable","will","change","the","behaviors","of","pickle",".","The","rule","to","tell","if","a","attribute","will","be","kept","or","dropped","when","dumping",".","The","rule","with","higher","priorities","is","on","the","top","-","in","the","config","attribute","list","-",">","always","dropped","-","in","the","include","attribute","list","-",">","always","kept","-","in","the","exclude","attribute","list","-",">","always","dropped","-","name","not","starts","with","`","_","`","-",">","kept","-","name","starts","with","`","_","`","-",">","kept","if","`","dump_all","`","is","true","else","dropped","It","provides","a","syntactic","sugar","for","distinguish","the","attributes","which","user","does","n't","want",".","-","For","examples",",","a","learnable","Datahandler","just","wants","to","save","the","parameters","without","data","when","dumping","to","disk"]
docstr: A general dumping method for object
  
  Parameters
  ----------
  obj : object
      the object to be dumped
  path : Union[Path, str]
      the target path the data will be dumped
docstr_tok: ["A","general","dumping","method","for","object","Parameters","--","--","--","--","--","obj",":","object","the","object","to","be","dumped","path",":","Union","[","Path",",","str","]","the","target","path","the","data","will","be","dumped"]
code: def general_dump(obj, path: Union[Path, str]):
      """
      A general dumping method for object
  
      Parameters
      ----------
      obj : object
          the object to be dumped
      path : Union[Path, str]
          the target path the data will be dumped
      """
      path = Path(path)
      if isinstance(obj, Serializable):
          obj.to_pickle(path)
      else:
          with path.open("wb") as f:
              pickle.dump(obj, f, protocol=C.dump_protocol_version)
  
file_path: qlib/qlib/utils/serial.py
imports: import pickle
  import dill
  from pathlib import Path
  from typing import Union
  from ..config import C
label_desc: Use image node_id 11 for calling the Serializable obj's underlying member method code with example usage: obj.general_dump(obj, path) without return types