Utility method for determining whether a prompt's
 prerequisites have already been fulfilled.
 @param [Hash] p The prompt
 @return [void]
335419
def _prereqs_fulfilled?(p)
      ret = true
      p.prereqs.each do |req|
        a = @prompts.find do |answer|
          answer.config_key == req[:config_key] &&
          answer.answer == req[:config_value]
        end
        ret = false if a.nil?
      end
      ret
    end
1261709
def p_start(self, p):
        ''''''
        p[0] = ast.Program(headers=p[1], definitions=p[2])
196878
private static String[] verifyImplicitOption(String[] args)
        throws ProblemException {

        boolean foundImplicit = false;
        for (String a : args) {
            if (a.startsWith("-implicit:")) {
                foundImplicit = true;
                if (!a.equals("-implicit:none")) {
                    throw new ProblemException("The only allowed setting for sjavac is -implicit:none, it is also the default.");
                }
            }
        }
        if (foundImplicit) {
            return args;
        }
        // -implicit:none not found lets add it.
        String[] newargs = new String[args.length+1];
        System.arraycopy(args,0, newargs, 0, args.length);
        newargs[args.length] = "-implicit:none";
        return newargs;
    }
1109820
def verify?(params)
      params = Utils.stringify_keys(params)
      return false if params['sign_type'] != @sign_type

      sign = params.delete('sign')
      # sign_type does not use in notify sign
      params.delete('sign_type')
      string = params_to_string(params)
      case @sign_type
      when 'RSA'
        ::Alipay::Sign::RSA.verify?(@alipay_public_key, string, sign)
      when 'RSA2'
        ::Alipay::Sign::RSA2.verify?(@alipay_public_key, string, sign)
      else
        raise "Unsupported sign_type: #{@sign_type}"
      end
    end
1366338
def final?
      !machine.events.any? do |event|
        event.branches.any? do |branch|
          branch.state_requirements.any? do |requirement|
            requirement[:from].matches?(name) && !requirement[:to].matches?(name, :from => name)
          end
        end
      end
    end
530114
def find_missing(message, all_params, given_opts, default_opts, header=None, prompt_missing=True):
    

    # are we missing anything?
    missing_params = list(set(all_params) - set(given_opts))

    num_prompted = 0

    if not missing_params:
        return given_opts, missing_params, num_prompted

    if not prompt_missing:
        # count the number missing, and go with defaults
        missing_values = set(default_opts) - set(given_opts)
        num_prompted = len(missing_values)
        given_opts.update(default_opts)

    else:
        if header is not None:
            print('-' * len(header))
            print(header)

        missing_values = interactive_prompt(message, missing_params, default_opts)
        num_prompted = len(missing_values)
        given_opts.update(missing_values)

    return given_opts, missing_params, num_prompted
224397
private void checkForPrompt() {
        //  Text has been entered, remove the prompt

        if (document.getLength() > 0) {
            setVisible(false);
            return;
        }

        //  Prompt has already been shown once, remove it

        if (showPromptOnce && focusLost > 0) {
            setVisible(false);
            return;
        }

        //  Check the Show property and component focus to determine if the
        //  prompt should be displayed.

        if (component.hasFocus()) {
            if (show == Show.ALWAYS
                    || show == Show.FOCUS_GAINED)
                setVisible(true);
            else
                setVisible(false);
        } else {
            if (show == Show.ALWAYS
                    || show == Show.FOCUS_LOST)
                setVisible(true);
            else
                setVisible(false);
        }
    }
1235731
protected boolean isRequired(Parameter parameter) {
        return parameter.isAnnotationPresent(Body.class)
                || parameter.isAnnotationPresent(Required.class)
                || parameter.isAnnotationPresent(NotNull.class);
    }
700887
def add_predicate
      # Checks whether the current value matches this state
      machine.define_helper(:instance, "#{qualified_name}?") do |machine, object|
        machine.states.matches?(object, name)
      end
    end
342906
def is_present(p):
    
    return lexeme(p).optional().map(lambda v: False if v is None else True)
149895
def matches_requirement?(query, option, requirement)
        !query.include?(option) || requirement.matches?(query[option], query)
      end
919205
public void check(ReconfigurationPlan p) throws SatConstraintViolationException {
        if (checkers.isEmpty()) {
            return;
        }

        checkModel(p.getOrigin(), true);

        if (!p.getActions().isEmpty()) {
            PriorityQueue<Action> starts = new PriorityQueue<>(p.getActions().size(), STARTS_CMP);
            PriorityQueue<Action> ends = new PriorityQueue<>(p.getActions().size(), ENDS_CMP);
            starts.addAll(p.getActions());
            ends.addAll(p.getActions());

            //Starts the actions
            int curMoment = starts.peek().getStart();
            while (!starts.isEmpty() || !ends.isEmpty()) {
                Action a = ends.peek();
                while (a != null && a.getEnd() == curMoment) {
                    ends.remove();
                    startingEvent = false;
                    visitAndThrowOnViolation(a);
                    visitEvents(a, Action.Hook.POST);
                    a = ends.peek();
                }
                a = starts.peek();

                while (a != null && a.getStart() == curMoment) {
                    starts.remove();
                    startingEvent = true;
                    visitEvents(a, Action.Hook.PRE);
                    visitAndThrowOnViolation(a);
                    a = starts.peek();
                }
                int nextEnd = Integer.MAX_VALUE;
                if (!ends.isEmpty()) {
                    nextEnd = ends.peek().getEnd();
                }
                int nextStart = Integer.MAX_VALUE;
                if (!starts.isEmpty()) {
                    nextStart = starts.peek().getStart();
                }

                curMoment = Math.min(nextEnd, nextStart);
            }
        }
        Model mo = p.getResult();
        if (mo == null) {
            throw new InconsistentSolutionException(p.getOrigin(), p, "The resulting reconfiguration plan is not applyable");
        }
        checkModel(mo, false);
    }
1073355
def required_parameters
      required = {}
      @input_parameters.each_value { |v| required[v.name] = v if v.required? }
      required
    end
292605
def verify(otp, counter, retries: 0)
      counters = (counter..counter + retries).to_a
      counters.find do |c|
        super(otp, at(c))
      end
    end
695472
private AuthorisationDecision checkPriviledge(Priviledge p, boolean includeOptional) {


        AuthorisationDecision decision = new AuthorisationDecision(true);
        for(AddressTemplate ref : requiredResources)
        {
            if(ref.isOptional()) continue; // skip optional ones

            final Constraints model = getConstraints(ref, includeOptional);
            if(model!=null)
            {
                if(!p.isGranted(model))
                {
                    decision.getErrorMessages().add(ref.toString());
                }
            }
            else
            {
                decision.getErrorMessages().add("Missing constraints for "+ ref.toString());
            }

            if(decision.hasErrorMessages())
            {
                decision.setGranted(false);
                break;
            }
        }

        return decision;
    }
292995
def verify_preconditions
      super

      if not gitlib.status.clean?
        GitProc::ChangeFileHelper.new(gitlib).offer_to_help_uncommitted_changes
      end

      raise ParkedChangesError.new(self) if gitlib.is_parked?
    end
86932
def completion_logic(input, options = {})
      o = {}
      options = options.dup

      o[k = :enabled_as] = options.delete(k)

      raise ArgumentError, "Unknown option(s): #{options.inspect}" if not options.empty?
      raise ArgumentError, "options[:enabled_as] must be given" if not o[:enabled_as]

      # Check if this input is related to us.
      if not mat = input.match(/\A#{o[:enabled_as]}\.((?:[^.].*)|)\z/)
        return nil
      end

      lookup = mat[1]

      # Parse lookup string into node name and prefix.
      global_name, prefix = if mat = lookup.match(/\A(?:([^.]*)|(.+)\.(.*?))\z/)
        if mat[1]
          # "something".
          ["", mat[1]]
        else
          # "something.other", "something.other.other.".
          [mat[2], mat[3]]
        end
      else
        # Handle no match just in case.
        ["", ""]
      end

      base = if global_name == ""
        # Base is root.
        nil
      else
        # Find a named base node. If not found, return no candidates right away.
        find_node(global_name) or return []
      end
      
      # Select sub-nodes.
      candidates = children_of(base).select do |node|
        # Select those matching `prefix`.
        node.name.to_s.index(prefix) == 0
      end.map do |node|
        # Provide 1+ candidates per item.
        case node
        when Node::Group
          # A neat trick to prevent IRB from appending a " " after group name.
          [node.name, "#{node.name}."]
        else
          [node.name]
        end.map(&:to_s)
      end.flatten(1).map do |s|
        # Convert to final names.
        [
          "#{o[:enabled_as]}.",
          ("#{global_name}." if global_name != ""),
          s,
        ].compact.join
      end

      candidates
    end