MCPcopy
hub / github.com/pex-tool/pex / for_value

Method for_value

pex/enum.py:175–187  ·  view source on GitHub ↗
(
        cls,  # type: Type[Enum[_V]]
        value,  # type: str
    )

Source from the content-addressed store, hash-verified

173
174 @classmethod
175 def for_value(
176 cls, # type: Type[Enum[_V]]
177 value, # type: str
178 ):
179 # type: (...) -> _V
180 for v in cls.values():
181 if v.value == value:
182 return v
183 raise ValueError(
184 "{!r} of type {} must be one of {}".format(
185 value, type(value), ", ".join(map(repr, cls.values()))
186 )
187 )

Callers 15

venv_bin_pathMethod · 0.45
inherit_pathMethod · 0.45
parse_schemeFunction · 0.45
try_loadMethod · 0.45
_lock_styleFunction · 0.45
PEX_VENV_BIN_PATHMethod · 0.45
PEX_INHERIT_PATHMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
iter_allMethod · 0.45
loadMethod · 0.45

Calls 2

valuesMethod · 0.45
joinMethod · 0.45

Tested by 3

test_basicsFunction · 0.36
tmpdir_factoryFunction · 0.36