Repository: kedro-org/kedro
File: kedro/ipython/__init__.py (Python)

Code before:
    imports = _prepare_imports(node_func)
    function_text = _prepare_function_body(node_func)
    function_text = "# Function Body\n" + function_text

    cells: list[str] = []
    cells.append(node_inputs)
    cells.append(imports)
    cells.append(function_text)
    return cells


def _find_node(node_name: str, pipelines: _ProjectPipelines) -> Node:
    for pipeline in pipelines.values():
        try:
            found_node: Node = pipeline.filter(node_names=[node_name]).nodes[0]
            return found_node
        except ValueError:
            continue
    # If reached the node was not found in the project
    raise ValueError(f"Node with name='{node_name}' not found in any pipelines.")


def _prepare_imports(node_func: Callable) -> str:
    """Prepare the import statements for loading a node."""
    python_file = inspect.getsourcefile(node_func)
    logger.info(f"Loading node defintion from {python_file}")

    # Confirm source file was found
    if python_file:
        import_statement = []
        with open(python_file) as file:
            # Parse any line start with from or import statement
            for line in file.readlines():
                if line.startswith("from") or line.startswith("import"):
                    import_statement.append(line.strip())

        clean_imports = "\n".join(import_statement).strip()
        return clean_imports
    else:
        raise FileNotFoundError(f"Could not find {node_func.__name__}")


def _prepare_node_inputs(node: Node) -> str:
    node_func = node.func
    signature = inspect.signature(node_func)

    node_inputs = node.inputs
    func_params = list(signature.parameters)

    statements = ["# Prepare necessary inputs for debugging"]


Review comment (suggestion):
```suggestion
    logger.info(f"Loading node definition from {python_file}")
```
typo

Code after:
    )
    node = _find_node(node_name, pipelines)
    node_func = node.func

    node_inputs = _prepare_node_inputs(node)
    imports = _prepare_imports(node_func)
    function_definition = _prepare_function_body(node_func)
    function_call = _prepare_function_call(node_func)

    cells: list[str] = []
    cells.append(node_inputs)
    cells.append(imports)
    cells.append(function_definition)
    cells.append(function_call)
    return cells


def _find_node(node_name: str, pipelines: _ProjectPipelines) -> Node:
    for pipeline in pipelines.values():
        try:
            found_node: Node = pipeline.filter(node_names=[node_name]).nodes[0]
            return found_node
        except ValueError:
            continue
    # If reached the node was not found in the project
    raise ValueError(
        f"Node with name='{node_name}' not found in any pipelines. Remember to specify the node name, not the node function."
    )


def _prepare_imports(node_func: Callable) -> str:
    """Prepare the import statements for loading a node."""
    python_file = inspect.getsourcefile(node_func)
    logger.info(f"Loading node definition from {python_file}")

    # Confirm source file was found
    if python_file:
        import_statement = []
        with open(python_file) as file:
            # Parse any line start with from or import statement
            for line in file.readlines():
                if line.startswith("from") or line.startswith("import"):
                    import_statement.append(line.strip())

        clean_imports = "\n".join(import_statement).strip()
        return clean_imports
    else:
        raise FileNotFoundError(f"Could not find {node_func.__name__}")


def _prepare_node_inputs(node: Node) -> str: