MCPcopy
hub / github.com/pallets/werkzeug / find

Method find

src/werkzeug/datastructures/accept.py:126–134  ·  view source on GitHub ↗

Get the position of an entry or return -1. :param key: The key to be looked up.

(self, key: str | tuple[str, float])

Source from the content-addressed store, hash-verified

124 return list.index(self, key)
125
126 def find(self, key: str | tuple[str, float]) -> int:
127 """Get the position of an entry or return -1.
128
129 :param key: The key to be looked up.
130 """
131 try:
132 return self.index(key)
133 except ValueError:
134 return -1
135
136 def values(self) -> cabc.Iterator[str]:
137 """Iterate over all values."""

Callers 6

parse_options_headerFunction · 0.45
_parse_dataMethod · 0.45
test_acceptMethod · 0.45
test_mime_acceptMethod · 0.45
test_basic_interfaceMethod · 0.45
test_accept_basicMethod · 0.45

Calls 1

indexMethod · 0.95

Tested by 4

test_acceptMethod · 0.36
test_mime_acceptMethod · 0.36
test_basic_interfaceMethod · 0.36
test_accept_basicMethod · 0.36