class_docstr: Extends the functionality of dill to serialize arbitrary objects.
  
  Originally intended to serialize the anomaly detector class
  `~greykite.detection.anomaly_detector.AnomalyDetector`, but
  can be potentially used to serialize other objects.
  
  Outputs a dictionary that can be serialized by `json` or `yaml` libraries.
  The dictionary has a tree structure, where each node is either a
  serialized object, or a pair of type and directory of serialized objects.
  The base of the directory is called "ROOT".
  
  Usage
  -----
      # To serialize
      pickler = GreykitePickler()
      pickled = pickler.dumps(obj)
      pickled_json = json.dumps(pickled)
  
      # To deserialize
      pickled = json.loads(pickled_json)
      obj = pickler.loads(pickled)
  
  Attributes
  ----------
  obj: any
      The object to be serialized.
class_docstr_tok: ["Extends","the","functionality","of","dill","to","serialize","arbitrary","objects",".","Originally","intended","to","serialize","the","anomaly","detector","class","`","~greykite.detection.anomaly_detector.AnomalyDetector","`",",","but","can","be","potentially","used","to","serialize","other","objects",".","Outputs","a","dictionary","that","can","be","serialized","by","`","json","`","or","`","yaml","`","libraries",".","The","dictionary","has","a","tree","structure",",","where","each","node","is","either","a","serialized","object",",","or","a","pair","of","type","and","directory","of","serialized","objects",".","The","base","of","the","directory","is","called","``","ROOT","''",".","Usage","--","--","-","#","To","serialize","pickler","=","GreykitePickler","(",")","pickled","=","pickler.dumps","(","obj",")","pickled_json","=","json.dumps","(","pickled",")","#","To","deserialize","pickled","=","json.loads","(","pickled_json",")","obj","=","pickler.loads","(","pickled",")","Attributes","--","--","--","--","--","obj",":","any","The","object","to","be","serialized","."]
docstr: Returns the keys from a `serialized_dict`, the output of `dumps`.
  
  Parameters
  ----------
  serialized_dict: `dict`
      The serialized dictionary.
  
  Returns
  -------
  keys: `tuple`
      A tuple of (pickles, directories, obj_types).
          - pickles: A list of keys that ends with ".pkl".
          - directories: A list of keys that ends with ".dir".
          - obj_types: A dictionary of {key: obj_type} for keys that ends with ".type".
docstr_tok: ["Returns","the","keys","from","a","`","serialized_dict","`",",","the","output","of","`","dumps","`",".","Parameters","--","--","--","--","--","serialized_dict",":","`","dict","`","The","serialized","dictionary",".","Returns","--","--","--","-","keys",":","`","tuple","`","A","tuple","of","(","pickles",",","directories",",","obj_types",")",".","-","pickles",":","A","list","of","keys","that","ends","with","``",".pkl","''",".","-","directories",":","A","list","of","keys","that","ends","with","``",".dir","''",".","-","obj_types",":","A","dictionary","of","{","key",":","obj_type","}","for","keys","that","ends","with","``",".type","''","."]
code: def _get_keys_from_serialized_dict(self, serialized_dict):
      """Returns the keys from a `serialized_dict`, the output of `dumps`.
  
      Parameters
      ----------
      serialized_dict: `dict`
          The serialized dictionary.
  
      Returns
      -------
      keys: `tuple`
          A tuple of (pickles, directories, obj_types).
              - pickles: A list of keys that ends with ".pkl".
              - directories: A list of keys that ends with ".dir".
              - obj_types: A dictionary of {key: obj_type} for keys that ends with ".type".
      """
      serialized_keys = list(serialized_dict.keys())
      pickles = [
          key for key in serialized_keys if PICKLE_KEY_EXTENSION in key
      ]
      directories = [
          key
          for key in serialized_keys
          if DIRECTORY_KEY_EXTENSION in key
      ]
      obj_types = {
          key.split(".")[0]: self.loads_from_str(serialized_dict[key])
          for key in serialized_keys
          if TYPE_KEY_EXTENSION in key
      }
      # There should be one dir_key for every type_key
      if not all(
          [
              directory.split(".")[0] in obj_types
              for directory in directories
          ]
      ):
          raise ValueError("type and directories do not match.")
  
      return pickles, directories, obj_types
  
file_path: greykite/greykite/detection/common/pickler.py
imports: import codecs
  import inspect
  from collections import OrderedDict
  import dill
label_desc: Use image node_id 15 for calling the GreykitePickler obj's underlying member method code with example usage: obj._get_keys_from_serialized_dict(serialized_dict) and returns: pickles,  directories,  obj_types