MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / ignore_undocumented

Function ignore_undocumented

diffusers/utils/check_repo.py:615–650  ·  view source on GitHub ↗

Rules to determine if `name` should be undocumented.

(name)

Source from the content-addressed store, hash-verified

613
614
615def ignore_undocumented(name):
616 """Rules to determine if `name` should be undocumented."""
617 # NOT DOCUMENTED ON PURPOSE.
618 # Constants uppercase are not documented.
619 if name.isupper():
620 return True
621 # ModelMixins / Encoders / Decoders / Layers / Embeddings / Attention are not documented.
622 if (
623 name.endswith("ModelMixin")
624 or name.endswith("Decoder")
625 or name.endswith("Encoder")
626 or name.endswith("Layer")
627 or name.endswith("Embeddings")
628 or name.endswith("Attention")
629 ):
630 return True
631 # Submodules are not documented.
632 if os.path.isdir(os.path.join(PATH_TO_DIFFUSERS, name)) or os.path.isfile(
633 os.path.join(PATH_TO_DIFFUSERS, f"{name}.py")
634 ):
635 return True
636 # All load functions are not documented.
637 if name.startswith("load_tf") or name.startswith("load_pytorch"):
638 return True
639 # is_xxx_available functions are not documented.
640 if name.startswith("is_") and name.endswith("_available"):
641 return True
642 # Deprecated objects are not documented.
643 if name in DEPRECATED_OBJECTS or name in UNDOCUMENTED_OBJECTS:
644 return True
645 # MMBT model does not really work.
646 if name.startswith("MMBT"):
647 return True
648 if name in SHOULD_HAVE_THEIR_OWN_PAGE:
649 return True
650 return False
651
652
653def check_all_objects_are_documented():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected