<commit_before>// @flow

export function relativeMouseOffset (event: MouseEvent, base: HTMLElement): { left: number, top: number } {
  const bounds = base.getBoundingClientRect()
  return {
    left: event.clientX - bounds.left,
    top: event.clientY - bounds.top
  }
}

export function round (value: number, min: number, max: number, step: number): number {
  const v = Math.max(min, Math.min(max, value))<commit_msg>Fix type annotation<commit_after>// @flow

export function relativeMouseOffset (
  offset: { clientX: number, clientY: number },
  base: HTMLElement
): { left: number, top: number } {
  const bounds = base.getBoundingClientRect()
  return {
    left: offset.clientX - bounds.left,
    top: offset.clientY - bounds.top
  }
}

export function round (value: number, min: number, max: number, step: number): number {
  const v = Math.max(min, Math.min(max, value))
{'fraction_non_alphanumeric': 0.1285551763367463, 'fraction_numerical': 0.0, 'mean_word_length': 4.116279069767442, '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': '7096763', 'n_tokens_mistral': 277, 'n_tokens_neox': 277, 'n_words': 84}