MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / exec_python

Method exec_python

python/openshell/sandbox.py:757–778  ·  view source on GitHub ↗
(
        self,
        function: Callable[..., object],
        *,
        args: Sequence[object] = (),
        kwargs: Mapping[str, object] | None = None,
        stream_output: bool = False,
        workdir: str | None = None,
        env: Mapping[str, str] | None = None,
        timeout_seconds: int | None = None,
    )

Source from the content-addressed store, hash-verified

755 )
756
757 def exec_python(
758 self,
759 function: Callable[..., object],
760 *,
761 args: Sequence[object] = (),
762 kwargs: Mapping[str, object] | None = None,
763 stream_output: bool = False,
764 workdir: str | None = None,
765 env: Mapping[str, str] | None = None,
766 timeout_seconds: int | None = None,
767 ) -> ExecResult:
768 if self._session is None:
769 raise SandboxError("sandbox context has not been entered")
770 return self._session.exec_python(
771 function,
772 args=args,
773 kwargs=kwargs,
774 stream_output=stream_output,
775 workdir=workdir,
776 env=env,
777 timeout_seconds=timeout_seconds,
778 )
779
780
781_PYTHON_CLOUDPICKLE_BOOTSTRAP = (

Calls 1

SandboxErrorClass · 0.85