MCPcopy
hub / github.com/mitmproxy/mitmproxy / stack_match

Function stack_match

mitmproxy/addons/next_layer.py:63–71  ·  view source on GitHub ↗
(
    context: Context, layers: Sequence[type[Layer] | tuple[type[Layer], ...]]
)

Source from the content-addressed store, hash-verified

61
62
63def stack_match(
64 context: Context, layers: Sequence[type[Layer] | tuple[type[Layer], ...]]
65) -> bool:
66 if len(context.layers) != len(layers):
67 return False
68 return all(
69 expected is Any or isinstance(actual, expected)
70 for actual, expected in zip(context.layers, layers)
71 )
72
73
74class NeedsMoreData(Exception):

Callers 2

test_next_layerFunction · 0.90
sMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_next_layerFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…