INNER CODE UNIT · Python

reset

Planetary-Computers/autotab-starter · src/server/server.py:48

    def reset(self):
        if self.driver:
            # Open a new tab
            self.driver.execute_script("window.open('');")
            # Switch to the new tab (it's the last one)
            self.driver.switch_to.window(self.driver.window_handles[-1])
            # Close all other tabs
            while len(self.driver.window_handles) > 1:
                self.driver.switch_to.window(self.driver.window_handles[0])
                self.driver.close()
            # Switch back to the remaining tab
            self.driver.switch_to.window(self.driver.window_handles[0])

    def run(self, code: str | List[str]):
        if isinstance(code, list):
            for cell in code:
                self.shell.run_cell(cell)
        else:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…