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: Load the serializable class from a filepath.
  
  Args:
      filepath (str): the path of file
  
  Raises:
      TypeError: the pickled file must be `type(cls)`
  
  Returns:
      `type(cls)`: the instance of `type(cls)`
docstr_tok: ["Load","the","serializable","class","from","a","filepath",".","Args",":","filepath","(","str",")",":","the","path","of","file","Raises",":","TypeError",":","the","pickled","file","must","be","`","type","(","cls",")","`","Returns",":","`","type","(","cls",")","`",":","the","instance","of","`","type","(","cls",")","`"]
code: def load(cls, filepath):
      """
      Load the serializable class from a filepath.
  
      Args:
          filepath (str): the path of file
  
      Raises:
          TypeError: the pickled file must be `type(cls)`
  
      Returns:
          `type(cls)`: the instance of `type(cls)`
      """
      with open(filepath, "rb") as f:
          object = cls.get_backend().load(f)
      if isinstance(object, cls):
          return object
      else:
          raise TypeError(
              f"The instance of {type(object)} is not a valid `{type(cls)}`!"
          )
  
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 9 for calling the Serializable obj's underlying member method code with example usage: obj.load(cls, filepath) and returns: object