INNER CODE UNIT · Python
_float_to_top
PyCQA/isort · isort/core.py:71
def _float_to_top(
input_stream: TextIO,
add_imports: list[str],
config: Config,
extension: str,
) -> _FloatToTopResult:
new_input = ""
current = ""
isort_off = False
verbose_output: list[str] = []
made_changes = False
for line in chain(input_stream, (None,)):
stripped_line = line.strip() if line is not None else ""
if isort_off and line is not None:
if stripped_line == "# isort: on":
isort_off = False
new_input += line
elif (