Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.submit = () => {
console.log("Submitting", this.state.source);
if (this.props.kernel && this.props.kernel.channels) {
this.props.kernel.channels.next(
messaging.executeRequest(this.state.source)
);
console.log("submitted!");
} else {
console.warn("Could not submit, kernel not connected");
debugger;
}
};
async function main() {
var identity = uuid();
const kernel = await launch("python3");
const channel = await createMainChannel(kernel.config);
const message = executeRequest('print("woo")');
const subscription = channel.subscribe(console.log);
channel.next(message);
console.log("sleep 1");
await new Promise(resolve => setTimeout(resolve, 1000));
channel.next(message);
console.log("sleep 2");
await new Promise(resolve => setTimeout(resolve, 1000));
kernel.spawn.kill("SIGKILL");
subscription.unsubscribe();
mergeMap(({ payload: { serverId, kernelName, source } }) => {
const channelPath = [
"entities",
"serversById",
serverId,
"server",
"activeKernelsByName",
kernelName,
"kernel",
"channel"
];
const channel = objectPath.get(state$.value, channelPath);
if (channel) {
channel.next(executeRequest(source));
}
return of(
actions.clearKernelOutputs({ serverId, kernelName }),
actions.setSource(source)
);
})
);
tap(mainChannel => mainChannel.next(executeRequest(imports()))),
tap(mainChannel => mainChannel.next(executeRequest(utils()))),
map(channelIndex =>
state$.value.jupyter.mainChannel.next(
executeRequest(plotERP(channelIndex))
)
),
onClick={() => {
this.props.kernel.channels.next(
messaging.executeRequest(this.state.source)
);
}}
>
map(filePathsArray =>
state$.value.jupyter.mainChannel.next(
executeRequest(loadCSV(filePathsArray))
)
),
executeCell(cell) {
this.props.mainChannel.subscribe(this.handleExecuteReturn);
this.props.mainChannel.next(executeRequest(cell));
}
map(variableName =>
state$.value.jupyter.mainChannel.next(
executeRequest(requestEpochsInfo(variableName))
)
),