unbound_segments : unbound_terminal FORWARD_SLASH unbound_segments
                            | unbound_terminal
347600
def p_unbound_segments(self, p):
        """"""
        p[0] = p[1]
        if len(p) > 2:
            p[0].extend(p[3])
569615
function(parts) {
        var urls = [];
        var start = '';

        // If the first part is empty
        // the original path begins with a slash so we
        // do that, too

        if( _.isEmpty(parts[0]) ) {
            start = '/';
            urls[0] = '/';      // would not be generated in reduce()
        }

        _.reduce(parts, function(acc, value){

            if( ! _.isString(value) || _.isEmpty(value) )
                return acc;

            acc += value;

            // Push w/out trailing slash
            urls.push(acc);

            return acc + '/';
        }, start );

        return urls;
    }
1162808
private void unwindPath(PathPointer unique_path, int unique_depth,
                          int path_index) {
    final float one_fraction = unique_path.get(path_index).one_fraction;
    final float zero_fraction = unique_path.get(path_index).zero_fraction;
    float next_one_portion = unique_path.get(unique_depth).pweight;

    for (int i = unique_depth - 1; i >= 0; --i) {
      if (one_fraction != 0) {
        final float tmp = unique_path.get(i).pweight;
        unique_path.get(i).pweight = next_one_portion * (unique_depth + 1)
                / ((i + 1) * one_fraction);
        next_one_portion = tmp - unique_path.get(i).pweight * zero_fraction * (unique_depth - i)
                / (float) (unique_depth + 1);
      } else {
        unique_path.get(i).pweight = (unique_path.get(i).pweight * (unique_depth + 1))
                / (zero_fraction * (unique_depth - i));
      }
    }

    for (int i = path_index; i < unique_depth; ++i) {
      unique_path.get(i).feature_index = unique_path.get(i+1).feature_index;
      unique_path.get(i).zero_fraction = unique_path.get(i+1).zero_fraction;
      unique_path.get(i).one_fraction = unique_path.get(i+1).one_fraction;
    }
  }
695720
function normalizePath(fsPath) {
  fsPath = path.normalize(fsPath);

  if (process.platform === 'win32') {
    fsPath = fsPath.replace(backwardSlashRegExp, '/');
  }

  return fsPath;
}
536934
def _parse_reserved_segment(self, fptr):
        
        offset = fptr.tell() - 2

        read_buffer = fptr.read(2)
        length, = struct.unpack('>H', read_buffer)
        if length > 0:
            data = fptr.read(length - 2)
        else:
            data = None

        segment = Segment(marker_id='0x{0:x}'.format(self._marker_id),
                          offset=offset, length=length, data=data)
        return segment
1177411
function preprocessMatchPath(segments) {
    const merged = mergeConsecutive(segments, '**');
    if (merged.length !== segments.length) {
        warn(`Consecutive '**' globs found
              (${segments.length - merged.length} excess).`);
    }
    segments = isolateGlobstarPattern(segments);
    segments = appendGlobstarIfTrailingSlash(segments);
    return mergeConsecutive([ ...segments,
                              ...(last(segments) === '**' ? ['*'] : []) ],
                            '**');
}
494340
def norm_path(path, allow_trailing=True):
    

    # Collapse slashes
    path = _path_re.sub('/', path)

    # Force a leading slash
    if path[0] != '/':
        path = '/' + path

    # Trim a trailing slash
    if not allow_trailing and path[-1] == '/':
        path = path[:-1]

    return path
924973
def _try_url_with_appended_slash(self):
        
        new_url_to_try = self.kwargs.get('path', '') + '/'
        if not new_url_to_try.startswith('/'):
            new_url_to_try = '/' + new_url_to_try
        if CMSPage.objects.published().filter(url=new_url_to_try).exists():
            return HttpResponsePermanentRedirect(new_url_to_try)
        else:
            raise Http404
1252028
function dedot(path) { // eslint-disable-line complexity
  const inpath = `${ path }`;
  let outpath = '';
  const len = inpath.length;

  // Walk over segment by segment.
  // Accumulate output onto outpath.

  // i is the index past last sep considered.
  let i = 0;
  if (len && inpath[0] === sep) {
    outpath = sep;
    i = 1;
  }
  const rootLength = outpath.length;

  for (let nextSep; i < len; i = nextSep + 1) {
    nextSep = apply(indexOf, inpath, [ sep, i ]);
    if (nextSep < 0) {
      nextSep = len;
    }
    const segmentLen = nextSep - i;
    switch (segmentLen) {
      case 0:
        continue;
      case 1:
        if (inpath[i] === '.') {
          continue;
        }
        break;
      case 2:
        if (inpath[i] === '.' && inpath[i + 1] === '.') {
          const lastOutSep = apply(lastIndexOf, outpath, [ sep ]);
          outpath = apply(substring, outpath, [ 0, max(rootLength, lastOutSep) ]);
          continue;
        }
        break;
      default:
        break;
    }
    const segment = apply(substring, inpath, [ i, nextSep ]);
    outpath = outpath + (outpath.length > rootLength ? sep : '') + segment;
  }

  return outpath;
}
805024
function _removeDotSegments(path) {
    if (path == '/')
        return '/';
    var /** @type {?} */ leadingSlash = path[0] == '/' ? '/' : '';
    var /** @type {?} */ trailingSlash = path[path.length - 1] === '/' ? '/' : '';
    var /** @type {?} */ segments = path.split('/');
    var /** @type {?} */ out = [];
    var /** @type {?} */ up = 0;
    for (var /** @type {?} */ pos = 0; pos < segments.length; pos++) {
        var /** @type {?} */ segment = segments[pos];
        switch (segment) {
            case '':
            case '.':
                break;
            case '..':
                if (out.length > 0) {
                    out.pop();
                }
                else {
                    up++;
                }
                break;
            default:
                out.push(segment);
        }
    }
    if (leadingSlash == '') {
        while (up-- > 0) {
            out.unshift('..');
        }
        if (out.length === 0)
            out.push('.');
    }
    return leadingSlash + out.join('/') + trailingSlash;
}
30903
function(searchPaths, sourceFoundCallback) {
    	this.sourceFoundCallback = sourceFoundCallback;
        if(searchPaths) {
            searchPaths = Array.isArray(searchPaths) ? searchPaths : [searchPaths];
            // For windows, convert to forward slashes
            this.searchPaths = searchPaths.map(path.normalize);
        }
        else {
            this.searchPaths = ['.'];
        }
    }
592348
private void switchToForward() {
        assert((checkDir < 0 && seq == rawSeq) || (checkDir == 0 && pos == limit));
        if(checkDir < 0) {
            // Turn around from backward checking.
            start = segmentStart = pos;
            if(pos == segmentLimit) {
                limit = rawLimit;
                checkDir = 1;  // Check forward.
            } else {  // pos < segmentLimit
                checkDir = 0;  // Stay in FCD segment.
            }
        } else {
            // Reached the end of the FCD segment.
            if(seq == rawSeq) {
                // The input text segment is FCD, extend it forward.
            } else {
                // The input text segment needed to be normalized.
                // Switch to checking forward from it.
                seq = rawSeq;
                pos = start = segmentStart = segmentLimit;
                // Note: If this segment is at the end of the input text,
                // then it might help to return false to indicate that, so that
                // we do not have to re-check and normalize when we turn around and go backwards.
                // However, that would complicate the call sites for an optimization of an unusual case.
            }
            limit = rawLimit;
            checkDir = 1;
        }
    }
418067
function _segment(file) {
  console.log();
  process.stdout.write(util.format('%s ', file));
}
278440
def maybe_patch_segment_data(self, f, segment_data):
        """"""
        segment_len = len(segment_data)
        file_pos = f.tell()  # file_pos is position in the .bin file
        if self.elf_sha256_offset >= file_pos and self.elf_sha256_offset < file_pos + segment_len:
            # SHA256 digest needs to be patched into this binary segment,
            # calculate offset of the digest inside the binary segment.
            patch_offset = self.elf_sha256_offset - file_pos
            # Sanity checks
            if patch_offset < self.SEG_HEADER_LEN or patch_offset + self.SHA256_DIGEST_LEN > segment_len:
                raise FatalError('Cannot place SHA256 digest on segment boundary' +
                                 '(elf_sha256_offset=%d, file_pos=%d, segment_size=%d)' %
                                 (self.elf_sha256_offset, file_pos, segment_len))
            if segment_data[patch_offset:patch_offset + self.SHA256_DIGEST_LEN] != b'\x00' * self.SHA256_DIGEST_LEN:
                raise FatalError('Contents of segment at SHA256 digest offset 0x%x are not all zero. Refusing to overwrite.' %
                                 self.elf_sha256_offset)
            assert(len(self.elf_sha256) == self.SHA256_DIGEST_LEN)
            # offset relative to the data part
            patch_offset -= self.SEG_HEADER_LEN
            segment_data = segment_data[0:patch_offset] + self.elf_sha256 + \
                segment_data[patch_offset + self.SHA256_DIGEST_LEN:]
        return segment_data
1258294
def reset
      segments = CrawlSegment.where('crawl_id = ? and parse_time is not null',
                                    self.id)
      segments.map { |segment| segment.update_attribute(:parse_time, nil) }

      status
    end
521220
def _forward(self):
        
        try:
            self.current_token = next(self.tokens)
        except StopIteration:
            raise MissingTokensError("Unexpected end of token stream at %d." %
                self.current_pos)
        self.current_pos += 1
1085813
function handlePathSlashes (path) {
                var cutIndex = 0;
                for (var i = 0; i < path.length - 1; i++) {
                    if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {
                        cutIndex = i + 1;
                    } else break;
                }

                return path.substr(cutIndex);
            }