Best Python code snippet using lisa_python
platform.py
Source:platform.py  
...117                username=host.username,118                private_key_file=host.private_key_file,119            )120        else:121            self.host_node = local_node_connect(122                name="libvirt-host",123                base_part_path=environment.environment_part_path,124                parent_logger=log,125            )126        self.__init_libvirt_conn_string()127        self._configure_environment(environment, log)128        with libvirt.open(self.libvirt_conn_str) as lv_conn:129            return self._configure_node_capabilities(environment, log, lv_conn)130    def _deploy_environment(self, environment: Environment, log: Logger) -> None:131        self._deploy_nodes(environment, log)132    def _delete_environment(self, environment: Environment, log: Logger) -> None:133        self._delete_nodes(environment, log)134        if self.host_node.is_remote:135            self._stop_port_forwarding(environment, log)...node.py
Source:node.py  
...535    def append(self, node: Node) -> None:536        self._list.append(node)537    def test_connections(self) -> bool:538        return all(run_in_parallel([x.test_connection for x in self._list]))539def local_node_connect(540    index: int = -1,541    name: str = "local",542    base_part_path: Optional[Path] = None,543    parent_logger: Optional[Logger] = None,544) -> Node:545    node_runbook = schema.LocalNode(name=name, capability=schema.Capability())546    node = Node.create(547        index=index,548        runbook=node_runbook,549        logger_name=name,550        base_part_path=base_part_path,551        parent_logger=parent_logger,552    )553    node.initialize()554    return node555def local() -> Node:556    """557    Return a default local node. There is no special configuration.558    """559    global __local_node560    if __local_node is None:561        __local_node = local_node_connect()562    return __local_node563def quick_connect(564    runbook: schema.Node,565    logger_name: str = "",566    index: int = -1,567    parent_logger: Optional[Logger] = None,568) -> Node:569    """570    setup node information and initialize connection.571    """572    node = Node.create(573        index, runbook, logger_name=logger_name, parent_logger=parent_logger574    )575    if isinstance(node, RemoteNode):...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
