MCPcopy
hub / github.com/VectifyAI/PageIndex / load

Method load

pageindex/utils.py:670–685  ·  view source on GitHub ↗

Load the configuration, merging user options with default values.

(self, user_opt=None)

Source from the content-addressed store, hash-verified

668 raise ValueError(f"Unknown config keys: {unknown_keys}")
669
670 def load(self, user_opt=None) -> config:
671 """
672 Load the configuration, merging user options with default values.
673 """
674 if user_opt is None:
675 user_dict = {}
676 elif isinstance(user_opt, config):
677 user_dict = vars(user_opt)
678 elif isinstance(user_opt, dict):
679 user_dict = user_opt
680 else:
681 raise TypeError("user_opt must be dict, config(SimpleNamespace) or None")
682
683 self._validate_keys(user_dict)
684 merged = {**self._default_dict, **user_dict}
685 return config(**merged)
686
687def create_node_mapping(tree):
688 """Create a flat dict mapping node_id to node for quick lookup."""

Callers 4

run_pageindex.pyFile · 0.80
__init__Method · 0.80
_read_jsonMethod · 0.80
page_indexFunction · 0.80

Calls 1

_validate_keysMethod · 0.95

Tested by

no test coverage detected