MCPcopy Index your code
hub / github.com/modelscope/modelscope / generate_ast_template

Function generate_ast_template

modelscope/utils/ast_utils.py:775–784  ·  view source on GitHub ↗
(file_path=None, force_rebuild=True)

Source from the content-addressed store, hash-verified

773
774
775def generate_ast_template(file_path=None, force_rebuild=True):
776 index = load_index(force_rebuild=force_rebuild)
777 if file_path is None:
778 local_path = p.resolve().parents[0]
779 file_path = os.path.join(local_path, TEMPLATE_FILE)
780 _save_index(index, file_path, with_template=True)
781 if not os.path.exists(file_path):
782 raise Exception(
783 'The index file is not create correctly, please double check')
784 return index
785
786
787if __name__ == '__main__':

Callers 2

load_from_prebuiltFunction · 0.85

Calls 3

load_indexFunction · 0.85
_save_indexFunction · 0.85
existsMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…