class_docstr: Save data items to an input stream.
      
class_docstr_tok: ["Save","data","items","to","an","input","stream","."]
docstr: Dump a data item to the current input stream.
          
docstr_tok: ["Dump","a","data","item","to","the","current","input","stream","."]
code: def save(self, name, value, encoder="auto"):
      """Dump a data item to the current input stream."""
      log.debug("name = %s", name)
      pickle.dump(name, self.out_stream)
      if encoder is None or encoder is False:
          log.debug("encoder_name = %s", "no_encoder")
          pickle.dump("no_encoder", self.out_stream)
      elif callable(encoder):
          log.debug("encoder_name = %s", "custom_encoder")
          pickle.dump("custom_encoder", self.out_stream)
          encoder(value, self.out_stream)
      elif encoder == ".save" or (
          isinstance(value, Serializable) and encoder == "auto"
      ):
          log.debug("encoder_name = %s", "serializable.save")
          pickle.dump("serializable.save", self.out_stream)
          if (
              len(inspect.getfullargspec(value.save)[0]) == 3
          ):  # backward compat for MLflow, can remove 4/1/2021
              value.save(self.out_stream, value)
          else:
              value.save(self.out_stream)
      elif encoder == "auto":
          if isinstance(value, (int, float, str)):
              log.debug("encoder_name = %s", "pickle.dump")
              pickle.dump("pickle.dump", self.out_stream)
              pickle.dump(value, self.out_stream)
          else:
              log.debug("encoder_name = %s", "cloudpickle.dump")
              pickle.dump("cloudpickle.dump", self.out_stream)
              cloudpickle.dump(value, self.out_stream)
      else:
          raise ValueError(
              f"Unknown encoder type '{encoder}' given for serialization!"
          )
      log.debug("value = %s", str(value))
  
file_path: shap/shap/_serializable.py
imports: import inspect
  import logging
  import pickle
  import cloudpickle
  import numpy
label_desc: Use image node_id 4 for calling the Serializer obj's underlying member method code with example usage: obj.save(name, value, encoder) without return types