MCPcopy Create free account
hub / github.com/danielpatrickhug/GitModel / get_methods

Function get_methods

src/ast_parsers/python_ast_parser.py:35–44  ·  view source on GitHub ↗
(class_or_str)

Source from the content-addressed store, hash-verified

33
34
35def get_methods(class_or_str):
36 if isinstance(class_or_str, str):
37 class_or_str = ast.parse(class_or_str)
38
39 method_nodes = [node for node in ast.iter_child_nodes(class_or_str) if isinstance(node, ast.FunctionDef)]
40 method_sources = []
41 for node in method_nodes:
42 source_lines, _ = ast.get_source_segment(class_or_str, node)
43 method_sources.append("".join(source_lines).strip())
44 return method_sources
45
46
47def parse_github_repo(local_dir):

Callers 1

decompose_repoMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected