def _sync_dxpy_state(self): dxpy.set_api_server_info(host=environ.get("DX_APISERVER_HOST", None), port=environ.get("DX_APISERVER_PORT", None), protocol=environ.get("DX_APISERVER_PROTOCOL", None)) if "DX_SECURITY_CONTEXT" in environ: dxpy.set_security_context(json.loads(environ["DX_SECURITY_CONTEXT"])) if "DX_JOB_ID" in environ: dxpy.set_job_id(environ["DX_JOB_ID"]) dxpy.set_workspace_id(environ.get("DX_WORKSPACE_ID")) else: dxpy.set_job_id(None) dxpy.set_workspace_id(environ.get("DX_PROJECT_CONTEXT_ID")) dxpy.set_project_context(environ.get("DX_PROJECT_CONTEXT_ID"))