<commit_before>require 'uri'

module URI
  #
  # Normalizes a URI decoded path, into a proper absolute path.
  #
  def URI.expand_path(path)
    dirs = path.gsub(/[\/]{2,}/,'/').scan(/[^\/]*\/|[^\/]+$/)
    new_dirs = []

    dirs.each do |dir|
      if (dir == '..' || dir == '../')
        unless new_dirs == ['/']<commit_msg>Added YARD tags to URI.expand_path.<commit_after>require 'uri'

module URI
  #
  # Expands a URI decoded path, into a proper absolute path.
  #
  # @param [String] path
  #   The path from a URI.
  #
  # @return [String]
  #   The expanded path.
  #
  # @example
  #   URI.expand_path('./path')
  #   # => "path"
  #
  # @example
  #   URI.expand_path('test/../path')
  #   # => "path"
  #
  # @example
  #   URI.exand_path('/test/path/')
  #   # => "/test/path/"
  #
  # @example
  #   URI.expand_path('/test/../path')
  #   # => "/path"
  #
  def URI.expand_path(path)
    dirs = path.gsub(/[\/]{2,}/,'/').scan(/[^\/]*\/|[^\/]+$/)
    new_dirs = []

    dirs.each do |dir|
      if (dir == '..' || dir == '../')
        unless new_dirs == ['/']
{'fraction_non_alphanumeric': 0.2383612662942272, 'fraction_numerical': 0.00186219739292365, 'mean_word_length': 2.089080459770115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '330735', 'n_tokens_mistral': 433, 'n_tokens_neox': 428, 'n_words': 83}