def run_code(
        self,
        scripts: list[str],
        languages: Optional[List[str]] = None,
        timeout: Optional[int] = None,
        request_timeout: Optional[int] = None,
    ) -> list[Execution]:
        """
        Executes a batch of scripts in the sandbox environment.

        Args:
            scripts (list[str]): A list of code scripts to execute.
            languages (list[str], optional): List of programming languages for each script. If None, defaults to Python for all scripts.
            timeout (Optional[int], optional): The maximum execution time for each script in seconds. Defaults to 300 seconds.
            request_timeout (Optional[int], optional): The timeout for the HTTP request in seconds. Defaults to 30 seconds.

        Returns:
            list[Execution]: A list of Execution objects containing the results, logs, and errors (if any) for each script.
        """
        # Set default values for timeouts if not provided
        if timeout is None:
            timeout = 300  # Default to 5 minutes
        if request_timeout is None:
            request_timeout = 30  # Default to 30 seconds

        # Default to Python for all scripts if languages is not provided
        if languages is None:
            languages = ["python"] * len(scripts)

        # Prepare the payload for the HTTP POST request
        payload = {
            "scripts": scripts,
            "languages": languages,
            "timeout": timeout,
            "request_timeout": request_timeout,
        }

        # Send the request to the E2B Router
        response = requests.post(f"http://{self.router_url}/execute_batch", json=payload)
        if not response.ok:
            print(f"Request failed with status code: {response.status_code}")

        # Parse the response and construct Execution objects
        results = response.json()
        output = []
        for result in results:
            if result["execution"] is None:
                # If execution is None, create an empty Execution object
                # This can happen when a script times out or fails to execute
                execution = Execution()
            else:
                execution = Execution(
                    results=[Result(**r) for r in result["execution"]["results"]],
                    logs=result["execution"]["logs"],
                    error=(ExecutionError(**result["execution"]["error"]) if result["execution"]["error"] else None),
                    execution_count=result["execution"]["execution_count"],
                )
            output.append(execution)

        return output

        Executes a batch of scripts in the sandbox environment.

        Args:
            scripts (list[str]): A list of code scripts to execute.
            languages (list[str], optional): List of programming languages for each script. If None, defaults to Python for all scripts.
            timeout (Optional[int], optional): The maximum execution time for each script in seconds. Defaults to 300 seconds.
            request_timeout (Optional[int], optional): The timeout for the HTTP request in seconds. Defaults to 30 seconds.

        Returns:
            list[Execution]: A list of Execution objects containing the results, logs, and errors (if any) for each script.
        
src/open_r1/utils/routed_sandbox.py