Path 1: 39 calls (1.0)

'import io\nimport re\nimport sys\nfrom typing import List\n\nimport pytest\n\nfrom rich.console import Console\nfrom rich.theme import Theme\nfrom ri...

(True, 'import io\nimport re\nimport sys\nfrom typing import List\n\nimport pytest\n\nfrom rich.console import Console\nfrom rich.theme import Theme\n...

1def _process_code(self, code: str) -> Tuple[bool, str]:
2        """
3        Applies various processing to a raw code string
4        (normalises it so it always ends with a line return, dedents it if necessary, etc.)
5
6        Args:
7            code (str): The raw code string to process
8
9        Returns:
10            Tuple[bool, str]: the boolean indicates whether the raw code ends with a line return,
11                while the string is the processed code.
12        """
13        ends_on_nl = code.endswith("\n")
14        processed_code = code if ends_on_nl else code + "\n"
15        processed_code = (
16            textwrap.dedent(processed_code) if self.dedent else processed_code
17        )
18        processed_code = processed_code.expandtabs(self.tab_size)
19        return ends_on_nl, processed_code