<commit_before>@function color($value)
  @if type-of($value) == color
    @return true
  @else
    @return null

@function color_list($values)
  @if list($values)
    @each $value in $values
      @if color($value)
        @return true
      @else
        @return null
  @else
    @return null

@function optional_color_list($values)
  @if color($values)
    @return true
  @else if color_list($values)
    @return true
  @else
    @return null

@function luma($color)
  // Adapted from: https://gist.github.com/voxpelli/6304812
  $rgba: red($color), green($color), blue($color)
  $rgba2: ()
  @for $i from 1 through 3
    $rgb: nth($rgba, $i)
    $rgb: $rgb / 255
    $rgb: if($rgb < 0.03928, $rgb / 12.92, pow(($rgb + 0.055) / 1.055, 2.4))
    $rgba2: append($rgba2, $rgb)
  @return (0.2126 * nth($rgba2, 1) + 0.7152 * nth($rgba2, 2) + 0.0722 * nth($rgba2, 3)) * 100

$ruma-threshold: 100 / pi() !default

@function luma_contrast($color-1, $color-2: null)
  @if $color-2
    @if abs(luma($color-1) - luma($color-2)) > $ruma-threshold
      @return true
    @else
      @return null
  @else
    @return if(luma($color-1) < 51, dark, bright)

@function luma_value($color-1, $color-2: null)
  @if $color-2
    @return abs(luma($color-1) - luma($color-2))
  @else
    @return luma($color-1)

@function luma_which($color)
  @return if(luma($color-1) < 51, dark, bright)

@function luma_bright($color)
  @if luma($color) < 51
    @return null
  @else<commit_msg>Fix luma<commit_after>@function color($value)
  @if type-of($value) == color
    @return true
  @else
    @return null

@function color_list($values)
  @if list($values)
    @each $value in $values
      @if color($value)
        @return true
      @else
        @return null
  @else
    @return null

@function optional_color_list($values)
  @if color($values)
    @return true
  @else if color_list($values)
    @return true
  @else
    @return null

@function luma($color)
  // Adapted from: https://gist.github.com/voxpelli/6304812
  $rgba: red($color), green($color), blue($color)
  $rgba2: ()
  @for $i from 1 through 3
    $rgb: nth($rgba, $i)
    $rgb: $rgb / 255
    $rgb: if($rgb < 0.03928, $rgb / 12.92, pow(($rgb + 0.055) / 1.055, 2.4))
    $rgba2: append($rgba2, $rgb)
  @return (0.2126 * nth($rgba2, 1) + 0.7152 * nth($rgba2, 2) + 0.0722 * nth($rgba2, 3)) * 100

$ruma-threshold: 100 / pi() !default

@function luma_contrast($color-1, $color-2: null)
  @if $color-2
    @if abs(luma($color-1) - luma($color-2)) > $ruma-threshold
      @return true
    @else
      @return null
  @else
    @return if(luma($color-1) < 51, dark, bright)

@function luma_value($color-1, $color-2: null)
  @if $color-2
    @return abs(luma($color-1) - luma($color-2))
  @else
    @return luma($color-1)

@function luma_which($color)
  @return if(luma($color) < 51, dark, bright)

@function luma_bright($color)
  @if luma($color) < 51
    @return null
  @else
{'fraction_non_alphanumeric': 0.17428669645926434, 'fraction_numerical': 0.055345479546235817, 'mean_word_length': 3.139402560455192, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '528282', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1158, 'n_words': 278}