def key_for(self, obj):
        """For the given value, return its corresponding key."""
        for key, val in self.items():
            if val is obj:
                return key
        raise ValueError('The given object could not be found: %r' % obj)
For the given value, return its corresponding key.
cherrypy/process/win32.py