<commit_before>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { JupyterFrontEnd } from '@jupyterlab/application';

import { ToolbarButton } from '@jupyterlab/apputils';

import { ConsolePanel } from '@jupyterlab/console';

import { DocumentWidget } from '@jupyterlab/docregistry';

import { FileEditor } from '@jupyterlab/fileeditor';

import { NotebookPanel } from '@jupyterlab/notebook';

import { Kernel, Session } from '@jupyterlab/services';

import { bugIcon } from '@jupyterlab/ui-components';

import { DisposableSet } from '@lumino/disposable';

import { Widget } from '@lumino/widgets';

import { DebuggerModel } from './model';

import { DebugSession } from './session';

import { IDebugger } from './tokens';

import { ConsoleHandler } from './handlers/console';

import { FileHandler } from './handlers/file';

import { NotebookHandler } from './handlers/notebook';

/**
 * Add a button to the widget toolbar to enable and disable debugging.
 * @param widget The widget to add the debug toolbar button to.
 */
function updateToolbar(
  widget: DebuggerHandler.SessionWidget[DebuggerHandler.SessionType],
  onClick: () => void
) {
  const iconContainer = bugIcon.element({
    elementPosition: 'center'
  });
  const icon = new Widget({ node: iconContainer });
  widget.toolbar.addItem('debugger-icon', icon);

  const button = new ToolbarButton({
    iconClass: 'jp-ToggleSwitch',
    onClick,
    tooltip: 'Enable / Disable Debugger'
  });
  widget.toolbar.addItem('debugger-button', button);

  const elements = new DisposableSet();<commit_msg>Make the bug icon a toolbar button<commit_after>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { JupyterFrontEnd } from '@jupyterlab/application';

import { ToolbarButton } from '@jupyterlab/apputils';

import { ConsolePanel } from '@jupyterlab/console';

import { DocumentWidget } from '@jupyterlab/docregistry';

import { FileEditor } from '@jupyterlab/fileeditor';

import { NotebookPanel } from '@jupyterlab/notebook';

import { Kernel, Session } from '@jupyterlab/services';

import { bugIcon } from '@jupyterlab/ui-components';

import { DisposableSet } from '@lumino/disposable';

import { DebuggerModel } from './model';

import { DebugSession } from './session';

import { IDebugger } from './tokens';

import { ConsoleHandler } from './handlers/console';

import { FileHandler } from './handlers/file';

import { NotebookHandler } from './handlers/notebook';

/**
 * Add a button to the widget toolbar to enable and disable debugging.
 * @param widget The widget to add the debug toolbar button to.
 */
function updateToolbar(
  widget: DebuggerHandler.SessionWidget[DebuggerHandler.SessionType],
  onClick: () => void
) {
  const icon = new ToolbarButton({
    icon: bugIcon,
    tooltip: 'Enable / Disable Debugger',
    onClick
  });
  widget.toolbar.addItem('debugger-icon', icon);

  const button = new ToolbarButton({
    iconClass: 'jp-ToggleSwitch',
    tooltip: 'Enable / Disable Debugger',
    onClick
  });
  widget.toolbar.addItem('debugger-button', button);

  const elements = new DisposableSet();
{'fraction_non_alphanumeric': 0.12562344139650872, 'fraction_numerical': 0.0, 'mean_word_length': 4.457482993197279, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '454385', 'n_tokens_mistral': 973, 'n_tokens_neox': 956, 'n_words': 279}