This code defines a Node.js module that exports a JSON interface object and two functions, wireJson
and pathJson
, which transform a kernel_json
object into a new object that conforms to the JSON interface. The functions, wireJson
and pathJson
, modify the argv
property of the kernel_json
object to include specific elements, such as a connection file or a path, depending on their existence.
The code imports modules from the Core
module using the require
function and an importer
object, and then uses the imported functions to create a JSON object and perform logging and interface output. The JSON object is created using the wireJson
function and contains properties such as display_name
, argv
, and language
, which are then logged to the console along with the result of an interface
function call.
This code exports a set of functions that generate JSON objects for different kernel types used in kernel communication, including Python, Node.js, Jupyter Notebook, Bash, and Processing. Each function combines a base configuration with user-provided kernel JSON data to create a complete JSON object for use in kernel communication.
jupyter meta kernelThe languageInterface
JavaScript object is defined with properties for mimetypes, names, file extensions, versions, and tool settings, then exported as a module using module.exports
.
The code imports necessary modules and data, and defines the kernelInfoInterface
object with various properties that provide information about a kernel. The nativeKernelInfo
function takes a kernel_info
object, extends it with additional information, and returns an object with language, kernel, and meta data.
The code imports modules and interfaces from a parent folder and defines a metaKernelInterface
object with various properties. This object is then exported as a module, providing an interface for interacting with a kernel in a programming environment.
The code consists of two main functions, reassignProperties
and nativeMetaKernel
, which interact with a meta_kernel
object to fill in properties, create a new kernel instance, and perform installation and initialization tasks. The code imports various modules and functions from the ../Core
directory, utilizing an extend
function, metaKernelInterface
, and nativeMethods
to create a new kernel instance and perform additional tasks.
This code defines a set of functions for a meta kernel that manages and interacts with other kernels, including initialization, installation, messaging, and execution handling. The module exports these functions, which depend on libraries such as mkdirp
, fs
, and jupyter-kernelspec
, and can be used by other applications to interact with kernels.
This code defines a Node.js application with a socket-based kernel implementation, featuring meta-programming capabilities. It exports functions for initializing and responding to socket messages, and creates a new kernel instance from a provided meta_kernel object.
process meta kernelThe code is part of a Node.js application that interacts with a meta kernel, providing various functions to execute commands, inspect the system, and handle messages, while also managing subprocesses and enforcing an interface.
The code consists of several functions that interact with a meta kernel, including executing commands, inspecting the system, handling messages, and managing subprocesses. The code also enforces an interface and contains TODO comments suggesting it is still a work-in-progress.
test process meta kernelThe code imports dependencies from a Core
module and defines a testProcessKernel
function that creates a new kernel object, performs some operations on it, and resolves a Promise with the kernel object. The testProcessKernel
function is exported as a module and can be integrated with an external $
object, which is used to send its result or error to the outside.
This code imports modules and functions from a parent directory, sets up event listeners, and defines functions for initializing and responding to incoming messages in a meta kernel. The code exports the main functions (replMetaKernal
, do_respond
, and do_init
) to be used elsewhere in the program.
This JavaScript module exports a testProcessKernel
function that creates a new kernel instance and tests its functionality by executing a message and shutting down the kernel. The function uses the bashKernel
function to create a new kernel instance and sets up a custom do_respond
function to simulate a response to executed messages.
The code defines a JavaScript object wireKernelInterface
that extends the properties of metaKernelInterface
and implements required and optional kernel interface methods, as well as custom reply and protocol methods. The object is then exported as a module using module.exports
, making it available for use in other parts of the application.
The code consists of four functions: status
, onError
, onStdout
, and onStderr
, which handle responses to kernel requests, error handling, and standard output and error messages, respectively. These functions utilize the do_respond
and respond
methods to send messages to the shell and iopub sockets, providing status updates, error notifications, and streaming data.
The provided code is a Node.js module for a Jupyter kernel that handles messages between the kernel and the front-end, including setting up sockets, sending responses, and handling incoming messages.
Alternatively, you can break it down into two sentences:
The code initializes the kernel by setting up sockets, binding them to the kernel, and sending an idle status message back to the front-end. It also handles incoming messages from the front-end, sending responses and handling different message types, including control, shell, and stdin messages.
TODO jupyter wire kernelThe code imports various modules and functions, defines two helper functions addCB
and wireKernel
, and creates a wireKernel
class that extends the kernel object with methods to handle requests. The wireKernel
class and its interface are then exported as a module.
This code imports a module, declares variables and functions, and defines four functions (do_execute
, do_display
, do_shutdown
, do_complete
) that handle different types of requests, increment a counter, store functions and send responses, and execute promise chains to perform tasks and send replies.
This code sets up a system to handle different types of requests, including execution, display, shutdown, and completion, and defines functions to send responses and execute tasks accordingly. The code also uses promise chains to manage asynchronous operations and send replies to the kernel.
, node meta kernelThis Node.js module exports a function nodeMetaKernel
that returns a meta kernel for Node.js, which has methods for executing, checking, and initializing code. The meta kernel uses Babel for code transpilation and sandboxed execution with vm.runInThisContext
, and is wrapped with the socketMetaKernel
function.
The code imports custom modules from the ../Core
directory and uses them to test the functionality of a nodeMetaKernel
module, including logging its output and that of its do_message
method. The testNodeMetaKernel
function is then exported as a module and run in a test environment where the $
variable is defined.
The code imports various modules and functions, including a utility function to parse version numbers, and defines a nodeKernel
function that uses the imported modules to create a Node.js kernel. The nodeKernel
function is then exported as a module, making it available for use in other parts of the application.
The bashKernel
function creates a kernel for executing Bash code by initializing a kernel instance with a configuration that runs Bash code and echoes input, while the bashLanguage
function defines a language interface object for Bash code with properties such as name, version, and file extension. The bashLanguage
function uses Object.assign
to merge the provided properties with a default language_info
object.
This module exports four functions (parseMessage
, hash
, json
, and collapseMessage
) and several variables for message processing, formatting, and cryptographic operations. The functions can be used for tasks such as parsing messages, generating hashes, JSON-stringifying data, and collapsing messages into a compact format.
The setupSockets
function establishes multiple sockets based on a provided configuration and returns a promise resolving to an object with established sockets. A related setupSocket
function creates a single socket connection, also returning a promise that resolves to the established socket object.