safely load steps in place, excluding those that fail
    Args:
        steps: the steps to load
351931
def load(steps, reload=False):
    
    # work on collections by default for fewer isinstance() calls per call to load()
    if reload:
        _STEP_CACHE.clear()

    if callable(steps):
        steps = steps()

    if not isinstance(steps, collections.Iterable):
        return load([steps])[0]

    loaded = []
    for s in steps:
        digest = s._digest
        if digest in _STEP_CACHE:
            loaded.append(_STEP_CACHE[digest])
        else:
            try:
                s.load()
                _STEP_CACHE[digest] = s
                loaded.append(s)
            except(Exception):
                logging.warn('Error during step load:\n%s' %
                             util.indent(traceback.format_exc()))

    return loaded
357474
def refresh(self):
      '''
      '''
      # There's no GET endpoint for steps, so get the parent guide and loop
      # through its steps until we find the right one.
      response = requests.get('%s/guides/%s' % (API_BASE_URL, self.guideid))
      attributes = response.json()
      
      for step in attributes['steps']:
         if step['stepid'] == self.stepid:
            self._update(step)
            return
      raise Exception('Step with id %s not found in guide %s.' \
                      % (self.stepid, self.guideid))
911818
function(step, next) {
      var oldNext;
      if (!step.options.errorHandler) {
        next();
        return;
      }
      oldNext = step.next;
      step.next = function() {
        try {
          return oldNext.apply(null, arguments);
        } catch (error) {
          return step.options.errorHandler(step, error);
        }
      };
      return next();
    }
100671
public AddStepsRequest withStep(StepConfig step) {
        if (this.steps == null) {
            this.steps = new ArrayList<StepConfig>();
        }
        this.steps.add(step);
        return this;
    }
522823
def _add_step(self, pos):
        
        self._steps.append(pos)
        self._rec_x = pos[0]
        self._rec_y = pos[1]
290046
function chainStepsNoError() {
	var steps = slice.call(arguments).map(function(step) {
		return notHandlingError(step);
	});
	return chainSteps.apply(null, steps);
}
1198187
def _expand_inputs(step, steps=None):
    
    if steps is None:
        steps = set()

    for arg in step._kwargs.values():
        if isinstance(arg, Step):
            _expand_inputs(arg, steps=steps)
        elif util.is_instance_collection(arg, Step):
            for s in util.get_collection_values(arg):
                _expand_inputs(s, steps=steps)

    steps.add(step)
    return steps
497703
def _step(self) -> typing.Union[None, 'projects.ProjectStep']:
        
        import cauldron
        try:
            return cauldron.project.get_internal_project().current_step
        except Exception:
            return None
1037673
def renew_step_dir(step_dir: str):
    """"""
    if os.path.exists(step_dir):
        logging.info("Remove unfinished step %s", step_dir)
        shutil.rmtree(step_dir)
    logging.info("Create: %s", step_dir)
    os.makedirs(step_dir)
919039
function(step) {
            if (!step) {
                throw new Error('Not enough arguments');
            }


            if (Array.isArray(step)) {
                step.forEach(function(s) {
                    this.add(s);
                }, this);
            } else {
                if (step.nextDelay && step.nextDelay < 0) {
                    throw new Error('nextDelay property must be greater than 0');
                }

                if (step.fn && typeof(step.fn) !== 'function') {
                    throw new Error('The property fn must be a function');
                }

                if (step.autoDestroy && typeof(step.autoDestroy) !== 'boolean') {
                    throw new Error('The property autoDestroy must be a boolean');
                }

                if (step.preload && !Array.isArray(step.preload)) {
                    throw new Error('The property preload must be an array of urls');
                }

                this.steps.push(step);
            }
            return this;
        }
1235509
def _steps_to_slices():
    """"""
    if not (conf.core.timesteps or conf.core.snapshots):
        # default to the last snap
        conf.core.timesteps = None
        conf.core.snapshots = slice(-1, None, None)
        return
    elif conf.core.snapshots:
        # snapshots take precedence over timesteps
        # if both are defined
        conf.core.timesteps = None
        steps = conf.core.snapshots
    else:
        conf.core.snapshots = None
        steps = conf.core.timesteps
    steps = steps.split(':')
    steps[0] = int(steps[0]) if steps[0] else None
    if len(steps) == 1:
        steps.append(steps[0] + 1)
    steps[1] = int(steps[1]) if steps[1] else None
    if len(steps) != 3:
        steps = steps[0:2] + [1]
    steps[2] = int(steps[2]) if steps[2] else None
    steps = slice(*steps)
    if conf.core.snapshots is not None:
        conf.core.snapshots = steps
    else:
        conf.core.timesteps = steps
518033
def step_undefined_step_snippets_should_not_exist_for_table(context):
    
    assert context.table, "REQUIRES: table"
    for row in context.table.rows:
        step = row["Step"]
        step_undefined_step_snippet_should_not_exist_for(context, step)
82955
def steps_to_skip(step)
      dependent_steps = steps.values.find_all do |s|
        next if s.is_a? Steps::PlanStep
        action = persistence.load_action(s)
        action.required_step_ids.include?(step.id)
      end

      steps_to_skip = dependent_steps.map do |dependent_step|
        steps_to_skip(dependent_step)
      end.flatten

      steps_to_skip << step

      if step.is_a? Steps::RunStep
        finalize_step_id = persistence.load_action(step).finalize_step_id
        steps_to_skip << steps[finalize_step_id] if finalize_step_id
      end

      return steps_to_skip.uniq
    end
885505
def synchronize_step_names(
        project: 'projects.Project',
        insert_index: int = None
) -> Response:
    

    response = Response()
    response.returned = dict()

    if not project.naming_scheme:
        return response

    create_mapper_func = functools.partial(
        create_rename_entry,
        insertion_index=insert_index
    )

    step_renames = list([create_mapper_func(s) for s in project.steps])
    step_renames = list(filter(lambda sr: (sr is not None), step_renames))

    if not step_renames:
        return response

    try:
        backup_path = create_backup(project)
    except Exception as err:
        return response.fail(
            code='RENAME_BACKUP_ERROR',
            message='Unable to create backup name',
            error=err
        ).response

    try:
        step_renames = list([stash_source(sr) for sr in step_renames])
        step_renames = list([unstash_source(sr) for sr in step_renames])
    except Exception as err:
        return response.fail(
            code='RENAME_FILE_ERROR',
            message='Unable to rename files',
            error=err
        ).response

    response.returned = update_steps(project, step_renames)
    project.save()

    try:
        os.remove(backup_path)
    except PermissionError:
        pass

    return response
288426
private void setEnabledSteps() {

        // gets the important data
        boolean isAuth = isAuthenticated();
        boolean hasFalseErrors = badIntListBox.getItemCount() > 0;
        int currentStep = getCurrentStep();

        boolean login = true;
        boolean falseErrors = false;
        boolean omissions = false;
        boolean thanks = false;

        if(currentStep == STEP_THANKS) {

            login = falseErrors = omissions = false;
            thanks = true;

        } else if(isAuth) {

            if(hasFalseErrors) {
                falseErrors = true;
            }

            login = omissions = true;

        }

        setIsStepEnabled(STEP_LOGIN, login);
        setIsStepEnabled(STEP_FALSE_ERRORS, falseErrors);
        setIsStepEnabled(STEP_OMISSIONS, omissions);
        setIsStepEnabled(STEP_THANKS, thanks);

    }
189172
def _split_match_steps_into_match_traversals(match_steps):
    """"""
    output = []
    current_list = None
    for step in match_steps:
        if isinstance(step.root_block, QueryRoot):
            if current_list is not None:
                output.append(current_list)
            current_list = [step]
        else:
            current_list.append(step)

    if current_list is None:
        raise AssertionError(u'current_list was unexpectedly None: {}'.format(match_steps))
    output.append(current_list)

    return output
945996
def on_step_begin(self, step, logs={}):
        
        for callback in self.callbacks:
            # Check if callback supports the more appropriate `on_step_begin` callback.
            # If not, fall back to `on_batch_begin` to be compatible with built-in Keras callbacks.
            if callable(getattr(callback, 'on_step_begin', None)):
                callback.on_step_begin(step, logs=logs)
            else:
                callback.on_batch_begin(step, logs=logs)