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: configure the serializable object
  
  Parameters
  ----------
  kwargs may include following keys
  
      dump_all : bool
          will the object dump all object
      exclude : list
          What attribute will not be dumped
      include : list
          What attribute will be dumped
  
  recursive : bool
      will the configuration be recursive
docstr_tok: ["configure","the","serializable","object","Parameters","--","--","--","--","--","kwargs","may","include","following","keys","dump_all",":","bool","will","the","object","dump","all","object","exclude",":","list","What","attribute","will","not","be","dumped","include",":","list","What","attribute","will","be","dumped","recursive",":","bool","will","the","configuration","be","recursive"]
code: def config(self, recursive=False, **kwargs):
      """
      configure the serializable object
  
      Parameters
      ----------
      kwargs may include following keys
  
          dump_all : bool
              will the object dump all object
          exclude : list
              What attribute will not be dumped
          include : list
              What attribute will be dumped
  
      recursive : bool
          will the configuration be recursive
      """
      keys = {"dump_all", "exclude", "include"}
      for k, v in kwargs.items():
          if k in keys:
              attr_name = f"_{k}"
              setattr(self, attr_name, v)
          else:
              raise KeyError(f"Unknown parameter: {k}")
  
      if recursive:
          for obj in self.__dict__.values():
              # set flag to prevent endless loop
              self.__dict__[self.FLAG_KEY] = True
              if (
                  isinstance(obj, Serializable)
                  and self.FLAG_KEY not in obj.__dict__
              ):
                  obj.config(recursive=True, **kwargs)
              del self.__dict__[self.FLAG_KEY]
  
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 7 for calling the Serializable obj's underlying member method code with example usage: obj.config(recursive) without return types