<commit_before>import { Cookie, LocatorStrategy, Timeout } from './core';
import { Element } from './Element';
import { DELETE, GET, POST } from './rest';

/**
 * This object represents a WebDriver session.
 */
export class Session {
  private readonly host: string;
  private readonly sessionId: string;

  constructor(host: string, sessionId: string) {
    this.host = host;
    this.sessionId = sessionId;
  }

  /**
   * Close the session.
   * @see {@link https://www.w3.org/TR/webdriver/#delete-session|WebDriver spec}
   * @example
   * import { newSession } from 'w3c-webdriver';
   *
   * let session;
   *
   * (async () => {
   *   try {
   *     session = await newSession('http://localhost:4444', {
   *       desiredCapabilities: {
   *         browserName: 'Chrome'
   *       }
   *     });
   *   } catch (err) {
   *     console.log(err.stack);
   *   } finally {
   *     session.close();
   *   }
   * })();
   */
  public async close(): Promise<void> {
    await DELETE(`${this.host}/session/${this.sessionId}`);
  }

  /**
   * Navigate to a new URL.
   * @see {@link https://www.w3.org/TR/webdriver/#go|WebDriver spec}
   * @example
   * await session.go('http://localhost:8080');
   */
  public async go(
    // The URL to navigate to
    targetUrl: string
  ): Promise<void> {
    await POST(`${this.host}/session/${this.sessionId}/url`, { url: targetUrl });
  }

  /**
   * Get current URL
   * @see {@link https://www.w3.org/TR/webdriver/#get-current-url|WebDriver spec}
   * @example
   * const url = await session.getCurrentUrl();
   */
  public async getCurrentUrl(): Promise<string> {<commit_msg>fix comments for get current url<commit_after>import { Cookie, LocatorStrategy, Timeout } from './core';
import { Element } from './Element';
import { DELETE, GET, POST } from './rest';

/**
 * This object represents a WebDriver session.
 */
export class Session {
  private readonly host: string;
  private readonly sessionId: string;

  constructor(host: string, sessionId: string) {
    this.host = host;
    this.sessionId = sessionId;
  }

  /**
   * Close the session.
   * @see {@link https://www.w3.org/TR/webdriver/#delete-session|WebDriver spec}
   * @example
   * import { newSession } from 'w3c-webdriver';
   *
   * let session;
   *
   * (async () => {
   *   try {
   *     session = await newSession('http://localhost:4444', {
   *       desiredCapabilities: {
   *         browserName: 'Chrome'
   *       }
   *     });
   *   } catch (err) {
   *     console.log(err.stack);
   *   } finally {
   *     session.close();
   *   }
   * })();
   */
  public async close(): Promise<void> {
    await DELETE(`${this.host}/session/${this.sessionId}`);
  }

  /**
   * Navigate to a new URL.
   * @see {@link https://www.w3.org/TR/webdriver/#go|WebDriver spec}
   * @example
   * await session.go('http://localhost:8080');
   */
  public async go(
    // The URL to navigate to
    targetUrl: string
  ): Promise<void> {
    await POST(`${this.host}/session/${this.sessionId}/url`, { url: targetUrl });
  }

  /**
   * Get current page URL
   * @see {@link https://www.w3.org/TR/webdriver/#get-current-url|WebDriver spec}
   * @example
   * const currentUrl = await session.getCurrentUrl();
   * // currentUrl = 'http://localhost:8080'
   */
  public async getCurrentUrl(): Promise<string> {
{'fraction_non_alphanumeric': 0.16696696696696697, 'fraction_numerical': 0.008408408408408409, 'mean_word_length': 2.6324972737186476, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2255652', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1089, 'n_words': 242}