<commit_before>/// File path short cut for embeddable media
/// @author <NAME>
/// @access public
/// @param {string} $name - Name of media to append to url
/// @param {url} $path [get($bytes, 'media-path')] - Directory of media to display
/// @require {function} get - Return key value from a map
/// @throw Warning when $name does not have a valid extension
/// @return {url} url of media
/// @example scss
///   .foo {
///      background: path('kitten.jpg') no-repeat 0 0;
///   }
/// @example css
///   .foo {
///      background: url('path/to/kitten.jpg') no-repeat 0 0;
///   }
@function path($name, $path: get($bytes, 'media-path')) {
  $ext: '.mp4', '.webm', '.ogg', '.ogv', '.mp3', '.wav', '.oga', '.aac', '.flv', '.swf', '.png', '.jpg', '.jpeg', '.gif', '.bmp', '.svg';
  $warn: ();

  @each $item in $ext {
    @if str-slice($name, str-length($item) * -1) != $item {
      $warn: 'Invalid file extension for `path()`';
    }
  }

  @warn $warn;
  @return url('#{$path}/#{$name}');<commit_msg>finally fixed  and updated docs<commit_after>/// File path short cut for embeddable media
/// @author <NAME>
/// @access public
/// @param {string} $name - Name of media to append to url
/// @param {url} $path [_get-setting($_bytes-default, $bytes, 'media-path')] - Directory of media to display
/// @require {function} _get-setting - Gets setting based on defaults and user settings
/// @throw Error when $name does not have a valid extension
/// @return {url} url of media
/// @example scss
///   $bytes: (
///      'media-path': '../img';
///   ):
///   .foo {
///      background: path('kitten.jpg') no-repeat 0 0;
///   }
/// @example css
///   .foo {
///      background: url('../img/kitten.jpg') no-repeat 0 0;
///   }
@function path($name, $path: _get-setting($_bytes-default, $bytes, 'media-path')) {
  $ext: ('.mp4', '.webm', '.ogg', '.ogv', '.mp3', '.wav', '.oga', '.aac', '.flv', '.swf', '.png', '.jpg', '.jpeg', '.gif', '.bmp', '.svg');
  $valid-ext: false;

  @each $item in $ext {
    @if $item == str-slice($name, str-length($item) * -1) {
      $valid-ext: true;
    }
  }

  @if not $valid-text {
    @error '#{$name} has an invalid file extension for `path()`';
  }

  @return url('#{$path}/#{$name}');
{'fraction_non_alphanumeric': 0.2395505617977528, 'fraction_numerical': 0.006292134831460674, 'mean_word_length': 2.6793388429752065, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4594727', 'n_tokens_mistral': 785, 'n_tokens_neox': 760, 'n_words': 245}