code: def from_hash(self, hash):
          
          try:
              func = FuncReg.func_from_hash(hash)
          except KeyError as ke:
              raise ValueError(
                  "no matching multihash function", hash.name) from ke
          digest = hash.digest()
          return Multihash(func, digest)
docs: Create a `Multihash` from a hashlib-compatible `hash` object.
  
          >>> import hashlib
          >>> data = b'foo'
          >>> hash = hashlib.sha1(data)
          >>> digest = hash.digest()
          >>> mh = Multihash.from_hash(hash)
          >>> mh == (Func.sha1, digest)
          True
  
          Application-specific hash functions are also supported (see
          `FuncReg`).
  
          If there is no matching multihash hash function for the given `hash`,
          a `ValueError` is raised.