def __repr__(self):
        return "<Requirement(package={package}, version='{version}')>".format(
            package=self.package, version=self.version)
def lock_temp(self, key):
    self.lock(key)
    try:
      yield
    finally:
      self.unlock(key)