def name_from_value(self, value, default=core.UNSET, patterns=["*"]):
        """Find the longest name in the set of constants (optionally qualified by pattern)
        which matches value.
        """
        try:
            return max(
                (name for name in self.names(patterns) if self[name] == value),
                key=len
            )
        except __HOLE__:
            if default is core.UNSET:
                raise KeyError("No constant matching name %s and value %s" % (patterns, value))
            else:
                return default
dataset/ETHPy150Open tjguk/winsys/winsys/registry.py/RegistryConstants.name_from_value