MCPcopy Index your code
hub / github.com/RustPython/RustPython / validate

Method validate

Lib/logging/__init__.py:524–536  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

522 return fmt.find('$asctime') >= 0 or fmt.find(self.asctime_search) >= 0
523
524 def validate(self):
525 pattern = Template.pattern
526 fields = set()
527 for m in pattern.finditer(self._fmt):
528 d = m.groupdict()
529 if d['named']:
530 fields.add(d['named'])
531 elif d['braced']:
532 fields.add(d['braced'])
533 elif m.group(0) == '$':
534 raise ValueError('invalid format: bare \'$\' not allowed')
535 if not fields:
536 raise ValueError('invalid format: no fields')
537
538 def _format(self, record):
539 if defaults := self._defaults:

Callers

nothing calls this directly

Calls 5

setFunction · 0.85
finditerMethod · 0.80
groupdictMethod · 0.80
addMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected