MCPcopy Index your code
hub / github.com/docopt/docopt / Required

Class Required

docopt.py:226–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224
225
226class Required(ParentPattern):
227
228 def match(self, left, collected=None):
229 collected = [] if collected is None else collected
230 l = left
231 c = collected
232 for p in self.children:
233 matched, l, c = p.match(l, c)
234 if not matched:
235 return False, left, collected
236 return True, l, c
237
238
239class Optional(ParentPattern):

Callers 14

test_pattern_flatFunction · 0.90
test_parse_patternFunction · 0.90
test_required_matchFunction · 0.90
test_either_matchFunction · 0.90
test_one_or_more_matchFunction · 0.90
test_list_argument_matchFunction · 0.90
test_pattern_eitherFunction · 0.90
eitherMethod · 0.85

Calls

no outgoing calls

Tested by 11

test_pattern_flatFunction · 0.72
test_parse_patternFunction · 0.72
test_required_matchFunction · 0.72
test_either_matchFunction · 0.72
test_one_or_more_matchFunction · 0.72
test_list_argument_matchFunction · 0.72
test_pattern_eitherFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…