code: def decode_hook(self, hook):
          
          if hook.HasField('modfun'):
              return self.decode_modfun(hook.modfun)
          else:
              return {'name': bytes_to_str(hook.name)}
docs: Decodes a protobuf commit hook message into a dict. Used in
          bucket properties.
  
          :param hook: the hook to decode
          :type hook: riak.pb.riak_pb2.RpbCommitHook
          :rtype dict