docs: def register(nbtool):
      """
      Register the provided NBTool object
      """
      global _py_funcs
      _lazy_init()
  
      # Save references to the tool's load() and render() functions
      load_key = nbtool.origin + '|' + nbtool.id + '|load'
      render_key = nbtool.origin + '|' + nbtool.id + '|render'
      _py_funcs[load_key] = nbtool.load
      _py_funcs[render_key] = nbtool.render
  
      # Clean optional metadata for inclusion in JavaScript
      clean_description = "null" if nbtool.description is None else '"' + nbtool.description.replace('"','\\"') + '"'
      clean_version = "null" if nbtool.version is None else '"' + nbtool.version.replace('"','\\"') + '"'
      clean_tags = "null" if nbtool.tags is None else json.dumps(nbtool.tags)
      clean_attributes = "null" if nbtool.attributes is None else json.dumps(nbtool.attributes)
  
      # Pass the metadata to JavaScript
      IPython.display.display_javascript("""
          console.log('ok');
          NBToolManager.instance().register(new NBToolManager.NBTool({
              origin: "%s",
              id: "%s",
              name: "%s",
              description: %s,
              version: %s,
              tags: %s,
              attributes: %s,
              load: function() {
                  var x = Jupyter.notebook.kernel.execute('nbtools._py_funcs["%s"]()',
                      {
                          iopub: {
                              output: function(response) {
                                  // Print the return value of the Python code to the console
                                  console.log(response.content.data["text/plain"]);
                              }
                          }
                      },
                      {
                          silent: false,
                          store_history: false,
                          stop_on_error: true
                      });
                  return true;
              },
              render: function() {
                  var x = Jupyter.notebook.kernel.execute('nbtools._py_funcs["%s"]()',
                      {
                          iopub: {
                              output: function(response) {
                                  // Print the return value of the Python code to the console
                                  console.log(response.content.data["text/plain"]);
                              }
                          }
                      },
                      {
                          silent: false,
                          store_history: false,
                          stop_on_error: true
                      });
                  return null;
              },
          }));
      """ % (nbtool.origin, nbtool.id, nbtool.name,
             clean_description, clean_version, clean_tags, clean_attributes,
             load_key, render_key), raw=True)
      return True