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)
| 8 | logging.getLogger('codetext').setLevel(logging.ERROR) |
| 9 | |
| 10 | def 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 | |
| 24 | def get_parser(language: str): |
| 25 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected