def compute(self):
        if self.has_input('value') == self.has_input('hash'):
            raise ModuleError(self, "Set either 'value' or 'hash'")
        if self.has_input('value'):
            self._hash = self.get_input('value')._hash
        else:
            try:
                self._set_hash(self.get_input('hash'))
            except __HOLE__, e:
                raise ModuleError(self, e.message)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/persistent_archive/common.py/PersistentHash.compute