<commit_before>import { FactoryProvider, Inject, InjectionToken, Optional, Self, SkipSelf } from '@angular/core';
import { resourceDataNavigableRef } from './resource-data';

export interface Navigable {

  go(url: string): void;
}

/**
 * Safe-cast function for {@link Navigable} instances.
 * Returns `true` if `obj` is {@link Navigable}.
 */
export function isNavigable(obj: any): obj is Navigable {
  return obj && typeof obj.go === 'function';
}

/**
 * Injectable reference to {@link Navigable}.
 * Note that this doesn't have to be immutable class.
 */
export abstract class NavigableRef {

  /**
   * The actual {@link Navigable} instance.
   *
   * Note that since this class is not immutable by definition, there is no guarantee its value won't change.
   * Therefore its recommended to always keep the {@link NavigableRef} instance instead of dereferencing it.
   */
  abstract get navigable(): Navigable;
}

/**
 * Creates immutable {@link NavigableRef} instance from given value.
 */
export function makeNavigableRef(value: Navigable): NavigableRef {
  return new NavigableRefImpl(value);
}

class NavigableRefImpl extends NavigableRef {

  constructor(public readonly navigable: Navigable) {
    super();
  }
}

/**<commit_msg>Fixed declaration order of NavigableRefImpl<commit_after>import { FactoryProvider, Inject, InjectionToken, Optional, Self, SkipSelf } from '@angular/core';
import { resourceDataNavigableRef } from './resource-data';

export interface Navigable {

  go(url: string): void;
}

/**
 * Safe-cast function for {@link Navigable} instances.
 * Returns `true` if `obj` is {@link Navigable}.
 */
export function isNavigable(obj: any): obj is Navigable {
  return obj && typeof obj.go === 'function';
}

/**
 * Injectable reference to {@link Navigable}.
 * Note that this doesn't have to be immutable class.
 */
export abstract class NavigableRef {

  /**
   * The actual {@link Navigable} instance.
   *
   * Note that since this class is not immutable by definition, there is no guarantee its value won't change.
   * Therefore its recommended to always keep the {@link NavigableRef} instance instead of dereferencing it.
   */
  abstract get navigable(): Navigable;
}

class NavigableRefImpl extends NavigableRef {

  constructor(public readonly navigable: Navigable) {
    super();
  }
}

/**
 * Creates immutable {@link NavigableRef} instance from given value.
 */
export function makeNavigableRef(value: Navigable): NavigableRef {
  return new NavigableRefImpl(value);
}

/**
{'fraction_non_alphanumeric': 0.10828025477707007, 'fraction_numerical': 0.0, 'mean_word_length': 4.268343815513627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2453974', 'n_tokens_mistral': 741, 'n_tokens_neox': 728, 'n_words': 260}