<commit_before>// Functions
// ------------------------

// Strip the units from a string
@function strip-units($value) {
    @return $value / ($value * 0 + 1);
}

// Calculate px from a rem/em value
@function px-calc($rem, $base-val: 16) {
    @if unit($rem) == px {
        @return $rem;
    }
    @if not unitless($rem) {
        $rem: strip-units($rem);
    }
    @if not unitless($base-val) {
        $base-val: strip-units($base-val);
    }
    @return ($rem * $base-val) * 1px;
}

// Calculate rems from a px value
@function rem-calc($px, $base-val: 16) {
    @if unit($px) == rem {
        @return $px;
    }
    @if not unitless($px) {
        $px: strip-units($px);
    }
    @if not unitless($base-val) {
        $base-val: strip-units($base-val);
    }
    @return ($px / $base-val) * 1rem;
}

// Calculate ems from a px value
@function em-calc($px, $base-val: 16) {
    @if unit($px) == em {
        @return $px;
    }
    @if not unitless($px) {
        $px: strip-units($px);
    }
    @if not unitless($base-val) {
        $base-val: strip-units($base-val);
    }
    @return ($px / $base-val) * 1em;
}

// Mix white with another color
@function tint($color, $percent: 15%){
    @return mix(white, $color, $percent);
}

// Mix black with another color
@function shade($color, $percent: 15%){
    @return mix(black, $color, $percent);
}

// Create a random color
@function random-color($min: 0, $max: 255, $alpha: 1) {
    @if $min < 0 {
        $min: -1;
    } @else {
        $min: $min - 1;
    }
    @if $max > 255 {
        $max: 256;
    } @else {
        $max: $max + 1;
    }
    $range: $max - $min;
    $red: random($range) + $min;
    $green: random($range) + $min;
    $blue: random($range) + $min;
    @return rgba($red, $green, $blue, $alpha);
}

// Replace a string
@function str-replace($string, $search, $replace: '') {
    $index: str-index($string, $search);

    @if $index {
        @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
    }

    @return $string;
}<commit_msg>Update random-color function<commit_after>// Functions
// ------------------------

// Strip the units from a string
@function strip-units($value) {
    @return $value / ($value * 0 + 1);
}

// Calculate px from a rem/em value
@function px-calc($rem, $base-val: 16) {
    @if unit($rem) == px {
        @return $rem;
    }
    @if not unitless($rem) {
        $rem: strip-units($rem);
    }
    @if not unitless($base-val) {
        $base-val: strip-units($base-val);
    }
    @return ($rem * $base-val) * 1px;
}

// Calculate rems from a px value
@function rem-calc($px, $base-val: 16) {
    @if unit($px) == rem {
        @return $px;
    }
    @if not unitless($px) {
        $px: strip-units($px);
    }
    @if not unitless($base-val) {
        $base-val: strip-units($base-val);
    }
    @return ($px / $base-val) * 1rem;
}

// Calculate ems from a px value
@function em-calc($px, $base-val: 16) {
    @if unit($px) == em {
        @return $px;
    }
    @if not unitless($px) {
        $px: strip-units($px);
    }
    @if not unitless($base-val) {
        $base-val: strip-units($base-val);
    }
    @return ($px / $base-val) * 1em;
}

// Mix white with another color
@function tint($color, $percent: 15%){
    @return mix(white, $color, $percent);
}

// Mix black with another color
@function shade($color, $percent: 15%){
    @return mix(black, $color, $percent);
}

// Create a random color
@function random-color($min: 0, $max: 255, $alpha: 1, $red: null, $green: null, $blue: null) {
    @if $min < 0 {
        $min: -1;
    } @else {
        $min: $min - 1;
    }
    @if $max > 255 {
        $max: 256;
    } @else {
        $max: $max + 1;
    }

    $range: $max - $min;

    @if not $red { $red: random($range) + $min; }
    @if not $green { $green: random($range) + $min; }
    @if not $blue { $blue: random($range) + $min; }

    @return rgba($red, $green, $blue, $alpha);
}

// Replace a string
@function str-replace($string, $search, $replace: '') {
    $index: str-index($string, $search);

    @if $index {
        @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
    }

    @return $string;
}
{'fraction_non_alphanumeric': 0.20441347270615565, 'fraction_numerical': 0.0148664343786295, 'mean_word_length': 2.3072196620583716, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4714380', 'n_tokens_mistral': 1648, 'n_tokens_neox': 1571, 'n_words': 415}