Parses the next step in the association path.  If it's an association, we advance down the
 path.  Otherwise, it's an attribute, and we need to evaluate it as a comparison operation.
420106
def follow_path( steps, past_steps = [] )
      if steps.is_a?( Hash )
        steps.each do |step, next_steps|
          path_to_this_point = [past_steps, step].flatten
          reflection = reflection_for( path_to_this_point ) rescue nil
          if reflection
            follow_path( next_steps, path_to_this_point )
          else
            follow_comparison( next_steps, past_steps, step )
          end
        end
      elsif steps.is_a?( Array ) && steps.length == 2
        if reflection_for( past_steps )
          follow_comparison( steps, past_steps, :id )
        else
          follow_comparison( steps, past_steps[0..-2], past_steps[-1] )
        end
      else
        raise "invalid obligation path #{[past_steps, steps].inspect}"
      end
    end
404221
final boolean applyNewNode(Parser<?> parser, String name) {
    int physical = at;
    int logical = step;
    TreeNode latestChild = trace.getLatestChild();
    trace.push(name);
    if (parser.apply(this)) {
      trace.setCurrentResult(result);
      trace.pop();
      return true;
    }
    if (stillThere(physical, logical)) expected(name);
    trace.pop();
    // On failure, the erroneous path shouldn't be counted in the parse tree.
    trace.setLatestChild(latestChild);
    return false;
  }
655077
def next(self):
        
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Read the next block.
        self.fileobj.seek(self.offset)
        tarinfo = None
        while True:
            try:
                tarinfo = self.tarinfo.fromtarfile(self)
            except EOFHeaderError as e:
                if self.ignore_zeros:
                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                    self.offset += BLOCKSIZE
                    continue
            except InvalidHeaderError as e:
                if self.ignore_zeros:
                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                    self.offset += BLOCKSIZE
                    continue
                elif self.offset == 0:
                    raise ReadError(str(e))
            except EmptyHeaderError:
                if self.offset == 0:
                    raise ReadError("empty file")
            except TruncatedHeaderError as e:
                if self.offset == 0:
                    raise ReadError(str(e))
            except SubsequentHeaderError as e:
                raise ReadError(str(e))
            break

        if tarinfo is not None:
            self.members.append(tarinfo)
        else:
            self._loaded = True

        return tarinfo
703430
private void parsePathExpr() throws TTXPathException {

        if (is(TokenType.SLASH, true)) {
            // path expression starts from the root
            mPipeBuilder.addStep(new DocumentNodeAxis(getTransaction()));
            final TokenType type = mToken.getType();

            if (type != TokenType.END && type != TokenType.COMMA) {
                // all immediately following keywords or '*' are nametests, not
                // operators
                // leading-lone-slash constrain

                parseRelativePathExpr();
            }

        } else if (is(TokenType.DESC_STEP, true)) {
            // path expression starts from the root with a descendant-or-self
            // step
            mPipeBuilder.addStep(new DocumentNodeAxis(getTransaction()));

            final AbsAxis mAxis = new DescendantAxis(getTransaction(), true);

            mPipeBuilder.addStep(mAxis);

            parseRelativePathExpr();
        } else {
            parseRelativePathExpr();
        }
    }
372309
def advancing(self):
        
        if self._forward:
            raise ValueError("Already advancing")
        self._forward = True
        yield
        self._forward = False
1074295
def next(time, base)
      current = time
      until match?(current, base) && current > time
        pot_next = align(potential_next(current, base), base)
        pot_next += min_step if pot_next == current

        current = pot_next
      end

      current
    end
119925
def existing_subpath(root_path, valid_subpaths, tiebreaker='first',
                     verbose=VERYVERBOSE):
    
    # Find the oxford_style groundtruth directory
    for subpath in valid_subpaths:
        path  = join(root_path, subpath)
        if checkpath(path, verbose=verbose):
            if tiebreaker == 'first':
                return path
    raise AssertionError('none of the following subpaths exist: %r' %
                         (valid_subpaths,))
93889
def advance(self):
        
        try:
            return next(self._rules_iter)
        except InnerStopIteration:
            self._rules_iter = self._follow_rules()
            return StopIteration()
        except StopIteration:
            self._rules_iter = self._follow_rules()
            return final_rule
720716
private void parseRelativePathExpr() throws TTXPathException {

        parseStepExpr();

        while (mToken.getType() == TokenType.SLASH || mToken.getType() == TokenType.DESC_STEP) {

            if (is(TokenType.DESC_STEP, true)) {
                final AbsAxis mAxis = new DescendantAxis(getTransaction(), true);

                mPipeBuilder.addStep(mAxis);
            } else {
                // in this case the slash is just a separator
                consume(TokenType.SLASH, true);
            }
            parseStepExpr();
        }

    }
435539
private void parseIntersectExceptExpr() throws TTXPathException {

        parseInstanceOfExpr();

        boolean isIntersect = mToken.getContent().equals("intersect");

        while (is("intersect", true) || is("except", true)) {
            // parse second operand axis

            mPipeBuilder.addExpressionSingle();

            parseInstanceOfExpr();

            mPipeBuilder.addIntExcExpression(getTransaction(), isIntersect);

            isIntersect = mToken.getContent().equals("intersect");
        }

    }
925310
def path_eval(self, obj, keypath):
        '''
        '''
        segs = keypath.split('.')
        this = obj
        for seg in segs:
            if isinstance(this, dict):
                try:
                    this = this[seg]
                except KeyError:
                    raise self.InvalidPath()
            elif isinstance(this, (list, tuple)):
                if seg.isdigit():
                    this = this[int(seg)]
            else:
                try:
                    this = getattr(this, seg)
                except AttributeError:
                    raise self.InvalidPath()
        return this
127265
void advance(SimpleDependencyPath path) {
        if (path.length() >= maxPathLength)
            return;

        // Get the last node and last relation to decide how to expand.
        DependencyRelation lastRelation = path.lastRelation();
        DependencyTreeNode last = path.last(); 
        
        // Expand all of the possible relations from the last node, creating a
        // new path for each, except if the relation is the one that generated
        // this path.
        for (DependencyRelation rel : last.neighbors()) {
            // Skip re-adding the current relation
            if (lastRelation.equals(rel) || !acceptor.accept(rel))
                continue;
            SimpleDependencyPath extended = path.extend(rel);
            frontier.offer(extended);
        }
    }
947925
def traverse_one(self, attribute, source, target, visitor):
        
        if __debug__:
            self.__log_traverse_one(self.__trv_path, attribute, source, target)
        prx = source or target
        rel_op = RELATION_OPERATIONS.check(source, target)
        if prx.do_traverse() \
           and (rel_op == prx.relation_operation or attribute is None):
            for attr in prx.get_relationship_attributes():
                # Check cascade settings.
                if not bool(attr.cascade & rel_op):
                    continue
                if not source is None:
                    try:
                        attr_source = source.get_attribute_proxy(attr)
                    except AttributeError:
                        # If the source does not have the attribute set, we
                        # do nothing (as opposed to when the value is None).
                        continue
                else:
                    attr_source = None
                if not target is None:
                    attr_target = target.get_attribute_proxy(attr)
                else:
                    attr_target = None
                attr_rel_op = RELATION_OPERATIONS.check(attr_source,
                                                        attr_target)
                if attr_rel_op == RELATION_OPERATIONS.ADD:
                    if rel_op == RELATION_OPERATIONS.ADD:
                        parent = source
                    else:
                        parent = target
                elif attr_rel_op == RELATION_OPERATIONS.REMOVE:
                    parent = target
                else: # UPDATE
                    parent = target
                card = get_attribute_cardinality(attr)
                if card == CARDINALITY_CONSTANTS.ONE:
                    if attr_source is None and attr_target is None:
                        # If both source and target have None values, there is
                        # nothing to do.
                        continue
                    if attr_rel_op == RELATION_OPERATIONS.ADD:
#                        if not attr_source.get_id() is None:
#                            # We only ADD new items.
#                            continue
                        src_items = [attr_source]
                        tgt_items = None
                    elif attr_rel_op == RELATION_OPERATIONS.REMOVE:
                        src_items = None
                        tgt_items = [attr_target]
                    else: # UPDATE
                        src_items = [attr_source]
                        tgt_items = [attr_target]
                        src_id = attr_source.get_id()
                        tgt_id = attr_target.get_id()
                        if src_id != tgt_id:
                            if not src_id is None:
                                # If the source ID is None, this is a replace
                                # operation (ADD source, REMOVE target).
                                src_target = attr_target.get_matching(src_id)
                                if not src_target is None:
                                    tgt_items.append(src_target)
                else:
                    src_items = attr_source
                    tgt_items = attr_target
                self.__trv_path.push(parent, (source, target), attr, rel_op)
                self.traverse_many(attr, src_items, tgt_items, visitor)
                self.__trv_path.pop() # path.pop()
        visitor.visit(self.__trv_path, attribute, source, target)
1204701
def get_next_step(self):
        
        layer_mode = self.parent.step_kw_layermode.selected_layermode()
        if layer_mode == layer_mode_classified:
            new_step = self.parent.step_kw_classify
        elif layer_mode == layer_mode_continuous:
            new_step = self.parent.step_kw_threshold
        else:
            message = tr('Layer mode should be continuous or classified')
            raise InvalidWizardStep(message)
        return new_step
730953
def is_ready_to_next_step(self):
        
        return (bool(self.rbAggLayerFromCanvas.isChecked()
                     or self.rbAggLayerFromBrowser.isChecked()
                     or self.rbAggLayerNoAggregation.isChecked()))
334203
private void parseLocationStep(String selector,
                                 int start,
                                 int stepEnd)
    throws InvalidXPathSyntaxException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass,
               "parseLocationStep",
               "selector: " + selector + ", start: " + start + ", end: " + stepEnd);

    int stepStart = start;
    int posOpenBracket = selector.indexOf("[", start);
    if(posOpenBracket > stepEnd || posOpenBracket == -1)
    {
      // Set posOpenBracket to avoid further processing
      posOpenBracket = -1;
      // No brackets so process whole of the location step
      String step = selector.substring(start,stepEnd);
      // Set the full name into the identifier. The full name is used in position assignment when
      // determining uniqueness of names. Only a full name will do.
      String full = selector.substring(0,stepEnd);
      // Add an IdentifierImpl for the location step to the array list
      selOperands.add(createIdentifierForSubExpression(step, full, true, false));      
    }
    
    int posCloseBracket = selector.indexOf("]", start); 
 
    boolean wrapWholeStep = false;
    boolean foundPredicates = false;
    ArrayList tempSelOperands = new ArrayList();
    while (posOpenBracket >= 0)
    {
      foundPredicates = true;
      if(posCloseBracket < posOpenBracket)
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          tc.exit(this,cclass, "parseLocationStep", "bracket error"); 
        
        InvalidXPathSyntaxException iex = new InvalidXPathSyntaxException(selector);
        FFDC.processException(cclass,
            "com.ibm.ws.sib.matchspace.selector.impl.XPath10ParserImpl",
            iex,
            "1:372:1.16"); 
        
        throw iex;
      }
      else
      {
        // The full selector path up to this point
        String full = selector.substring(0,posOpenBracket);
        
        // Factor out the location step first but be careful we may have a predicate
        if(start != posOpenBracket)
        {
          // Go ahead and deal with the location step
          String step = selector.substring(start,posOpenBracket);
          // Add an IdentifierImpl for the location step to the array list
          tempSelOperands.add(createIdentifierForSubExpression(step, full, true, false));    
        }
        
        // Now parse the predicate
        String predicate = selector.substring(posOpenBracket + 1,posCloseBracket);
        Selector parsedPredicate = parsePredicate(predicate, full);
        
        // Check whether we were able to parse
        if(parsedPredicate == null)
        {
          // Unable to parse the expression, so we need to wrap the entire step
//          tempSelOperands.add(createIdentifierForSubExpression(predicate, false));
          wrapWholeStep = true;
          break;
        }
        else
        {
          // we were able to parse the expression with the MatchParser
          // Check that the predicate has Simple tests only
          if(!Matching.isSimple(parsedPredicate))
          {
            wrapWholeStep = true;
            break;
          }
          parsedPredicate.setExtended();
          tempSelOperands.add(parsedPredicate);
        }       
      }
        
      // Move to beyond the close bracket
      start = posCloseBracket+1;
      //Are there any more brackets?
      posOpenBracket = selector.indexOf("[", start);
      posCloseBracket = selector.indexOf("]", start); 
      
      // Have we found the last bracket in this location step?
      if(posOpenBracket > stepEnd || posOpenBracket == -1)
      {
        // Set posOpenBracket to avoid further processing
        posOpenBracket = -1; 
      }
    } // eof while
    
    if(foundPredicates)
    {
      // If we determined that we cannot parse this location step, then wrap it
      if(wrapWholeStep)
        wrapLocationStep(selector, stepStart,stepEnd);
      else
      {
        // PostProcessing here
        selOperands.addAll(tempSelOperands);
      }
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(this,cclass, "parseLocationStep");      
  }
928353
public Optional<Object> objectEvaluate( WalkedPath walkedPath ) {
        // Grap the data we need from however far up the tree we are supposed to go
        PathStep pathStep = walkedPath.elementFromEnd( upLevel );

        if ( pathStep == null ) {
            return Optional.empty();
        }

        Object treeRef = pathStep.getTreeRef();

        // Now walk down from that level using the subPathReader
        if ( subPathReader == null ) {
            return Optional.of( treeRef );
        }
        else {
            return subPathReader.read( treeRef, walkedPath );
        }
    }