<commit_before><?php
  // {{{ string scanpath(string[] path, string home)
  //     Scans a path file 
  function scanpath($paths, $home) {
    $inc= '';
    foreach ($paths as $path) {
      if (!($d= @opendir($path))) continue;
      while ($e= readdir($d)) {
        if ('.pth' !== substr($e, -4)) continue;

        foreach (file($path.DIRECTORY_SEPARATOR.$e) as $line) {
          if ('#' === $line{0}) {
            continue;
          } else if ('~' === $line{0}) {
            $base= $home; $line= substr($line, 1);
          } else if ('/' === $line{0} || (':' === $line{1} && '\\' === $line{2})) {
            $base= '';
          } else {
            $base= $path; 
          }

          $inc.= $base.DIRECTORY_SEPARATOR.strtr(trim($line), '/', DIRECTORY_SEPARATOR).PATH_SEPARATOR;
        }
      }
      closedir($d);
    }
    return $inc;
  }
  // }}}

  $webroot= getenv('DOCUMENT_ROOT').'/..';

  $paths= array();
  foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
    $paths[]= ('~' == $path{0}
      ? str_replace('~', $webroot, $path)
      : $path
    );
  }
  set_include_path(scanpath($paths, $webroot));
  <commit_msg>- Remove last (empty) element from include_path # Prevent Fatal ("Classpath element [] not found")<commit_after><?php
  // {{{ string scanpath(string[] path, string home)
  //     Scans a path file 
  function scanpath($paths, $home) {
    $inc= '';
    foreach ($paths as $path) {
      if (!($d= @opendir($path))) continue;
      while ($e= readdir($d)) {
        if ('.pth' !== substr($e, -4)) continue;

        foreach (file($path.DIRECTORY_SEPARATOR.$e) as $line) {
          if ('#' === $line{0}) {
            continue;
          } else if ('~' === $line{0}) {
            $base= $home; $line= substr($line, 1);
          } else if ('/' === $line{0} || (':' === $line{1} && '\\' === $line{2})) {
            $base= '';
          } else {
            $base= $path; 
          }

          $inc.= $base.DIRECTORY_SEPARATOR.strtr(trim($line), '/', DIRECTORY_SEPARATOR).PATH_SEPARATOR;
        }
      }
      closedir($d);
    }
    return $inc;
  }
  // }}}

  $webroot= getenv('DOCUMENT_ROOT').'/..';

  $paths= array();
  foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
    $paths[]= ('~' == $path{0}
      ? str_replace('~', $webroot, $path)
      : $path
    );
  }
  set_include_path(rtrim(scanpath($paths, $webroot), PATH_SEPARATOR));
  
{'fraction_non_alphanumeric': 0.2198844884488449, 'fraction_numerical': 0.006600660066006601, 'mean_word_length': 2.229027962716378, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2041579', 'n_tokens_mistral': 880, 'n_tokens_neox': 850, 'n_words': 167}