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

import {
  Token
} from '@phosphor/coreutils';


/* tslint:disable */
/**
 * The default window resolver token.
 */
export
const IWindowResolver = new Token<IWindowResolver>('@jupyterlab/coreutils:IWindowResolver');
/* tslint:enable */


/**
 * The description of a window name resolver.
 */
export
interface IWindowResolver {
  /**
   * Resolve a window name to use as a handle among shared resources.
   *
   * @param candidate - A potential preferred default window name.
   *
   * @returns A promise that resolves to a window name.
   */
  resolve(candidate: string): Promise<string>;
}


/**
 * A concrete implementation of a window name resolver.
 */
export
class WindowResolver implements IWindowResolver {
  /**
   * Resolve a window name to use as a handle among shared resources.
   *
   * @param candidate - A potential preferred default window name.
   *
   * @returns A promise that resolves to a window name.
   */
  resolve(candidate: string): Promise<string> {
    return Private.windowName();
  }
}

/*
 * A namespace for private module data.
 */
namespace Private {
  /**
   * The timeout (in ms) to wait for beacon responders.
   */
  const TIMEOUT = 100;

  /**
   * The internal prefix for private local storage keys.
   */
  const PREFIX = '@jupyterlab/coreutils:StateDB';

  /**
   * The local storage beacon key.
   */
  const BEACON = `${PREFIX}:beacon`;<commit_msg>Candidate should not be part of resolve call. Move to instantiation options.<commit_after>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
  Token
} from '@phosphor/coreutils';


/* tslint:disable */
/**
 * The default window resolver token.
 */
export
const IWindowResolver = new Token<IWindowResolver>('@jupyterlab/coreutils:IWindowResolver');
/* tslint:enable */


/**
 * The description of a window name resolver.
 */
export
interface IWindowResolver {
  /**
   * Resolve a window name to use as a handle among shared resources.
   *
   * @returns A promise that resolves to a window name.
   */
  resolve(): Promise<string>;
}


/**
 * A concrete implementation of a window name resolver.
 */
export
class WindowResolver implements IWindowResolver {
  constructor(options: WindowResolver.IOptions = { candidate: '' }) {
    this._candidate = options.candidate;
  }

  /**
   * Resolve a window name to use as a handle among shared resources.
   *
   * @returns A promise that resolves to a window name.
   */
  resolve(): Promise<string> {
    console.log('Start with candidate:', this._candidate);
    return Private.windowName();
  }

  private _candidate: string;
}


/**
 * A namespace for `WindowResolver` statics.
 */
export
namespace WindowResolver {
  /**
   * The instantiation options for a window resolver.
   */
  export
  interface IOptions {
    /**
     * A potential preferred default window name.
     */
    candidate: string;
  }
}

/*
 * A namespace for private module data.
 */
namespace Private {
  /**
   * The timeout (in ms) to wait for beacon responders.
   */
  const TIMEOUT = 100;

  /**
   * The internal prefix for private local storage keys.
   */
  const PREFIX = '@jupyterlab/coreutils:StateDB';

  /**
   * The local storage beacon key.
   */
  const BEACON = `${PREFIX}:beacon`;
{'fraction_non_alphanumeric': 0.10904804008252283, 'fraction_numerical': 0.0017683465959328027, 'mean_word_length': 3.1491442542787285, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '238237', 'n_tokens_mistral': 1005, 'n_tokens_neox': 973, 'n_words': 348}