def lookup(enumvals):
        """Lookup from int/string to Enum instance for provided values"""
        result = {int(v): v for v in enumvals}
        result.update({v.name: v for v in enumvals})
        return result
Lookup from int/string to Enum instance for provided values
recipes/Python/577921_PythEnum__andor_namedinteger/recipe-577921.py