class_docstr: A subclass of pickler, to do cryptographic hashing, rather than
  pickling.
class_docstr_tok: ["A","subclass","of","pickler",",","to","do","cryptographic","hashing",",","rather","than","pickling","."]
code: def save_global(self, obj, name=None, pack=struct.pack):
      # We have to override this method in order to deal with objects
      # defined interactively in IPython that are not injected in
      # __main__
      kwargs = dict(name=name, pack=pack)
      del kwargs["pack"]
      try:
          Pickler.save_global(self, obj, **kwargs)
      except pickle.PicklingError:
          Pickler.save_global(self, obj, **kwargs)
          module = getattr(obj, "__module__", None)
          if module == "__main__":
              my_name = name
              if my_name is None:
                  my_name = obj.__name__
              mod = sys.modules[module]
              if not hasattr(mod, my_name):
                  # IPython doesn't inject the variables define
                  # interactively in __main__
                  setattr(mod, my_name, obj)
  
imports: import pickle
  import hashlib
  import sys
  import types
  import struct
  import io
  import decimal
label_desc: Use image node_id 5 for calling the Hasher obj's underlying member method code with example usage: obj.save_global(obj, name, pack) without return types