To learn steps in the recipe, in the good order
10254
public function followStepsRecipe(): callable
    {
        return function (array $steps, array $onError): ChefInterface {
            /**
             * @var Chef $this
             */
            $this->steps = \array_values($steps);
            $this->stepsNames = \array_flip(\array_keys($steps));
            $this->onError = $onError;

            $this->updateStates();

            return $this;
        };
    }
980724
def check_recipe_choices(self):
        ''''''
        recipes = []
        built_recipes = self.ctx.recipe_build_order
        for recipe in self.depends:
            if isinstance(recipe, (tuple, list)):
                for alternative in recipe:
                    if alternative in built_recipes:
                        recipes.append(alternative)
                        break
        for recipe in self.opt_depends:
            if recipe in built_recipes:
                recipes.append(recipe)
        return sorted(recipes)
589106
def execute_recipe!(stack_name, layer, recipe, app_name = Momentum.config[:app_base_name])
      raise "No recipe provided" unless recipe
      stack = Momentum::OpsWorks.get_stack(@ow, stack_name)
      app = Momentum::OpsWorks.get_app(@ow, stack, app_name)
      layer_names = layer ? [layer] : Momentum.config[:app_layers]
      layers = Momentum::OpsWorks.get_layers(@ow, stack, layer_names)
      instance_ids = layers.inject([]) { |ids, l| ids + Momentum::OpsWorks.get_online_instance_ids(@ow, layer_id: l[:layer_id]) }
      raise 'No online instances found!' if instance_ids.empty?
      @ow.create_deployment(
        stack_id: stack[:stack_id],
        app_id: app[:app_id],
        command: {
          name: 'execute_recipes',
          args: {
            'recipes' => [recipe.to_s]
          }
        },
        instance_ids: instance_ids
      )
    end
906454
def _run_checks(self):
        '''
        '''
        if self.recipe is not None:

            # Does the recipe provided exist?
            if not os.path.exists(self.recipe):
                bot.error("Cannot find %s, is the path correct?" %self.recipe)
                sys.exit(1)

            # Ensure we carry fullpath
            self.recipe = os.path.abspath(self.recipe)
817249
def depsolve(self):
        """"""
        # load everything
        requires = {}
        provides = {}
        for mode, r in self.recipes.items():
            l = self.load_recipe_object(mode)

            for field, vv in l.requirements().items():
                if vv.type.isproduct():
                    name = vv.type.name()
                    pe = ProductEntry(name, mode, field)
                    requires[name] = pe

            for field, vv in l.products().items():
                if vv.type.isproduct():
                    name = vv.type.name()
                    pe = ProductEntry(name, mode, field)
                    provides[name] = pe

        return requires, provides
119601
private final void step3() {
        if (k == 0)
            return;
        /* For Bug 1 */
        switch (sb.charAt(k-1)) { 
        case 'a':
            if (ends("ational")) 
                r("ate");
            else if (ends("tional"))
                r("tion"); 
            break;
        case 'c':
            if (ends("enci")) 
                r("ence");
            else if (ends("anci")) 
                r("ance");
            break;
        case 'e':
            if (ends("izer")) 
                r("ize");
            break;
        case 'l':
            if (ends("bli"))
                r("ble");
            else if (ends("alli"))
                r("al");  
            else if (ends("entli"))
                r("ent"); 
            else if (ends("eli"))
                r("e");
            else if (ends("ousli"))
                r("ous");
            break; 
        case 'o':
            if (ends("ization")) 
                r("ize"); 
            else if (ends("ation")) 
                r("ate"); 
            else if (ends("ator"))
                r("ate");
            break;
        case 's':
            if (ends("alism")) 
                r("al"); 
            else if (ends("iveness")) 
                r("ive");
            else if (ends("fulness")) 
                r("ful"); 
            else if (ends("ousness")) 
                r("ous"); 
            break; 
        case 't': 
            if (ends("aliti")) 
                r("al"); 
            else if (ends("iviti"))
                r("ive");
            else if (ends("biliti")) 
                r("ble");
            break;
        case 'g':
            if (ends("logi")) 
                r("log");
            break;
        }
    }
886381
def get_bootstrap_from_recipes(cls, recipes, ctx):
        ''''''
        info('Trying to find a bootstrap that matches the given recipes.')
        bootstraps = [cls.get_bootstrap(name, ctx)
                      for name in cls.list_bootstraps()]
        acceptable_bootstraps = []
        for bs in bootstraps:
            if not bs.can_be_chosen_automatically:
                continue
            possible_dependency_lists = expand_dependencies(bs.recipe_depends)
            for possible_dependencies in possible_dependency_lists:
                ok = True
                for recipe in possible_dependencies:
                    recipe = Recipe.get_recipe(recipe, ctx)
                    if any([conflict in recipes for conflict in recipe.conflicts]):
                        ok = False
                        break
                for recipe in recipes:
                    try:
                        recipe = Recipe.get_recipe(recipe, ctx)
                    except ValueError:
                        conflicts = []
                    else:
                        conflicts = recipe.conflicts
                    if any([conflict in possible_dependencies
                            for conflict in conflicts]):
                        ok = False
                        break
                if ok and bs not in acceptable_bootstraps:
                    acceptable_bootstraps.append(bs)
        info('Found {} acceptable bootstraps: {}'.format(
            len(acceptable_bootstraps),
            [bs.name for bs in acceptable_bootstraps]))
        if acceptable_bootstraps:
            info('Using the first of these: {}'
                 .format(acceptable_bootstraps[0].name))
            return acceptable_bootstraps[0]
        return None
157291
def list_recipes():
    """"""
    for recipe in lib.get_recipes():
        margin_left = lib.get_margin(len(recipe['name']))
        print("{0}{1}{2}".format(
            recipe['name'], margin_left, recipe['description']))
1327349
public function runRecipe(): callable
    {
        return function (array $workPlan): ChefInterface {
            //If this method is called, $this->recipe is a valid RecipeInterface instance
            $this->workPlan = \array_merge($this->workPlan, $workPlan);
            $this->cooking = true;

            $this->updateStates();

            $this->prepare();

            $this->continue();

            $this->clean();

            return $this;
        };
    }
322589
def get_dependency_tuple_list_for_recipe(recipe, blacklist=None):
    
    if blacklist is None:
        blacklist = set()
    assert(type(blacklist) == set)
    if recipe.depends is None:
        dependencies = []
    else:
        # Turn all dependencies into tuples so that product will work
        dependencies = fix_deplist(recipe.depends)

        # Filter out blacklisted items and turn lowercase:
        dependencies = [
            tuple(set(deptuple) - blacklist)
            for deptuple in dependencies
            if tuple(set(deptuple) - blacklist)
        ]
    return dependencies
146781
function(step, next) {
      var currentStep;
      step.steps = copyArray(step.steps);
      currentStep = -1;
      step.next = function() {
        var args;
        currentStep++;
        args = [step].concat(copyArray(arguments));
        if (currentStep >= step.steps.length) {
          return step.callback.apply(null, args);
        } else {
          return step.steps[currentStep].apply(null, args);
        }
      };
      return next();
    }
262269
def evaluate_recipes
      self.class.recipes.each do |meth, args|
        case arity = method(meth).arity
        when 1, -1
          send(meth, args)
        else
          send(meth)
        end
      end
    end
206390
def load_recipe(self, recipe):
    
    self.recipe = recipe
    for module_description in recipe['modules']:
      # Combine CLI args with args from the recipe description
      module_name = module_description['name']
      module = self.config.get_module(module_name)(self)
      self._module_pool[module_name] = module
587707
function craftingSteps (tree, steps = [], index = 0) {
  // Skip any tree parts where nothing needs to be crafted
  if (!tree.components || tree.craft === false) {
    return steps
  }

  // Go through the existing steps, and if we already have a step
  // with this id, just add up the quantities
  let stepIndex = steps.findIndex(step => step.id === tree.id)
  if (stepIndex !== -1) {
    steps[stepIndex].quantity += tree.usedQuantity
    steps[stepIndex].components = steps[stepIndex].components
      .map(component => {
        let treeComponent = tree.components.find(tC => tC.id === component.id)
        component.quantity += treeComponent.totalQuantity
        return component
      })
    index = stepIndex
  }

  // We don't have a step like this yet, push a new one at the given index
  if (stepIndex === -1) {
    steps.splice(index, 0, {
      id: tree.id,
      output: tree.output,
      quantity: tree.usedQuantity,
      components: tree.components.map(component => {
        return {id: component.id, quantity: component.totalQuantity}
      })
    })
  }

  // Go through the components and push them after the index of their parent
  tree.components.map(component => craftingSteps(component, steps, index + 1))
  return steps
}
1157883
def create_shipfile(target, source, env):
    """"""

    source_dir = os.path.dirname(str(source[0]))
    recipe_name = os.path.basename(str(source[0]))[:-5]

    resman = RecipeManager()

    resman.add_recipe_actions(env['CUSTOM_STEPS'])
    resman.add_recipe_folder(source_dir, whitelist=[os.path.basename(str(source[0]))])
    recipe = resman.get_recipe(recipe_name)

    recipe.archive(str(target[0]))
1342147
def get_nodes_with_recipe(recipe_name, environment=None):
    
    prefix_search = recipe_name.endswith("*")
    if prefix_search:
        recipe_name = recipe_name.rstrip("*")
    for n in get_nodes(environment):
        recipes = get_recipes_in_node(n)
        for role in get_roles_in_node(n, recursive=True):
            recipes.extend(get_recipes_in_role(role))
        if prefix_search:
            if any(recipe.startswith(recipe_name) for recipe in recipes):
                yield n
        else:
            if recipe_name in recipes:
                yield n
608553
private void dcstep() {
		double sgnd = gp*Math.signum(gx);

		// the new step
		double stpf;

		if( fp > fx ) {
			stpf = handleCase1();
		} else if( sgnd < 0 ) {
			stpf = handleCase2();
		} else if( Math.abs(gp) < Math.abs(gx) ) {
			stpf = handleCase3();
		} else {
			stpf = handleCase4();
		}

		// update the bracket which contains the solution
		if( fp > fx ) {
			// found an upper bound
			sty = stp;
			fy = fp;
			gy = gp;
		} else {
			// see if its on the other side of the dip
			if( sgnd < 0 ) {
				sty = stx;
				fy = fx;
				gy = gx;
			}
			stx = stp;
			fx = fp;
			gx = gp;
		}
		
		stp = stpf;
		updated = true;
	}