MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / get_node_text

Function get_node_text

src/hyperagent/code_search.py:10–22  ·  view source on GitHub ↗

Extract a substring from the given code. Args: start_byte (int): The starting index from where to begin the extraction. end_byte (int): The ending index where to stop the extraction. code (str): The string from which to extract the substring. Returns: s

(start_byte: int, end_byte: int, code: str)

Source from the content-addressed store, hash-verified

8logging.getLogger('codetext').setLevel(logging.ERROR)
9
10def get_node_text(start_byte: int, end_byte: int, code: str) -> str:
11 """
12 Extract a substring from the given code.
13
14 Args:
15 start_byte (int): The starting index from where to begin the extraction.
16 end_byte (int): The ending index where to stop the extraction.
17 code (str): The string from which to extract the substring.
18
19 Returns:
20 str: The extracted substring from the start_byte to end_byte.
21 """
22 return code[start_byte:end_byte]
23
24def get_parser(language: str):
25 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected