MCPcopy
hub / github.com/LawRefBook/Laws / __reorder_files

Method __reorder_files

scripts/request.py:520–539  ·  view source on GitHub ↗
(self, files)

Source from the content-addressed store, hash-verified

518 self.categories = categories
519
520 def __reorder_files(self, files):
521 # 必须有 parser
522 files = list(
523 filter(
524 lambda x: x["type"] in self.parser,
525 files,
526 )
527 )
528
529 if len(files) == 0:
530 return []
531
532 if len(files) > 1:
533 # 按照 parser 的位置排序, 优先使用级别
534 files = sorted(
535 files,
536 key=lambda x: self.parser.index(x["type"])
537 )
538
539 return files
540
541 def is_bypassed_law(self, item) -> bool:
542 title = item["title"].replace("中华人民共和国", "")

Callers 1

parse_lawMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected