Validates the workflow steps from ``start`` to ``end``, inclusive.

        Returns a dict describing the validation state of the workflow.
425062
def validate_steps(self, request, workflow, start, end):
        
        errors = {}
        for step in workflow.steps[start:end + 1]:
            if not step.action.is_valid():
                errors[step.slug] = dict(
                    (field, [six.text_type(error) for error in errors])
                    for (field, errors) in step.action.errors.items())
        return {
            'has_errors': bool(errors),
            'workflow_slug': workflow.slug,
            'errors': errors,
        }
945104
def get_next_step(self):
        
        if self.validate_extent():
            new_step = self.parent.step_fc_summary
        else:
            new_step = self.parent.step_fc_extent_disjoint
        return new_step
1330233
def _validate(self):
        
        # disable methods matching before validation
        self._disable_patching = True
        # validation by Invariant.validate
        self._validate_base(self)
        # enable methods matching after validation
        self._disable_patching = False
627490
def on_batch_end(self, last_loss, epoch, num_batch, **kwargs:Any)->None:
        ""
        if self.stop: return True #to skip validation after stopping during training
        if torch.isnan(last_loss):
            print (f'Epoch/Batch ({epoch}/{num_batch}): Invalid loss, terminating training.')
            return {'stop_epoch': True, 'stop_training': True, 'skip_validate': True}
159723
def _get_validated_enabled_regions(json_spec, from_command_line):
    
    enabled_regions = dxpy.executable_builder.get_enabled_regions('globalworkflow',
                                                                  json_spec,
                                                                  from_command_line,
                                                                  WorkflowBuilderException)
    if not enabled_regions:
        enabled_regions = []
        if not dxpy.WORKSPACE_ID:
            msg = "A context project must be selected to enable a workflow in the project's region."
            msg += " You can use 'dx select' to select a project. Otherwise you can use --region option"
            msg += " to select a region in which the workflow should be enabled"
            raise(WorkflowBuilderException(msg))
        region = dxpy.api.project_describe(dxpy.WORKSPACE_ID,
                                           input_params={"fields": {"region": True}})["region"]

        enabled_regions.append(region)

    if not enabled_regions:
        raise AssertionError("This workflow should be enabled in at least one region")

    return set(enabled_regions)
764754
def track_end(self):
        
        self.__tracking = False
        changes = self.__changes
        self.__changes = {}
        return changes
1209957
def on_step_end(self, step, logs={}):
        
        self.total_steps += 1
        if self.total_steps % self.interval != 0:
            # Nothing to do.
            return

        filepath = self.filepath.format(step=self.total_steps, **logs)
        if self.verbose > 0:
            print('Step {}: saving model to {}'.format(self.total_steps, filepath))
        self.model.save_weights(filepath, overwrite=True)
596020
def check_lifecycle(self):
        
        with self._lock:
            # Validation flags
            was_valid = self.state == StoredInstance.VALID
            can_validate = self.state not in (
                StoredInstance.VALIDATING,
                StoredInstance.VALID,
            )

            # Test the validity of all handlers
            handlers_valid = self.__safe_handlers_callback(
                "is_valid", break_on_false=True
            )

            if was_valid and not handlers_valid:
                # A dependency is missing
                self.invalidate(True)
            elif (
                can_validate and handlers_valid and self._ipopo_service.running
            ):
                # We're all good
                self.validate(True)
446538
def on_step_end(self, step, logs={}):
        
        for callback in self.callbacks:
            # Check if callback supports the more appropriate `on_step_end` callback.
            # If not, fall back to `on_batch_end` to be compatible with built-in Keras callbacks.
            if callable(getattr(callback, 'on_step_end', None)):
                callback.on_step_end(step, logs=logs)
            else:
                callback.on_batch_end(step, logs=logs)
426560
def get_workflows() -> dict:
    
    keys = DB.get_keys("workflow_definitions:*")
    known_workflows = dict()
    for key in keys:
        values = key.split(':')
        if values[1] not in known_workflows:
            known_workflows[values[1]] = list()
        known_workflows[values[1]].append(values[2])

    return known_workflows
998122
def _begin_validation(
        session: UpdateSession,
        config: config.Config,
        loop: asyncio.AbstractEventLoop,
        downloaded_update_path: str)\
        -> asyncio.futures.Future:
    
    session.set_stage(Stages.VALIDATING)
    cert_path = config.update_cert_path\
        if config.signature_required else None

    validation_future \
        = asyncio.ensure_future(loop.run_in_executor(
            None, file_actions.validate_update,
            downloaded_update_path, session.set_progress, cert_path))

    def validation_done(fut):
        exc = fut.exception()
        if exc:
            session.set_error(getattr(exc, 'short', str(type(exc))),
                              str(exc))
        else:
            rootfs_file = fut.result()
            loop.call_soon_threadsafe(_begin_write,
                                      session,
                                      loop,
                                      rootfs_file)
    validation_future.add_done_callback(validation_done)
    return validation_future
30527
def getObjectWorkflowStates(self):
        
        workflow = getToolByName(self, 'portal_workflow')
        states = {}
        for w in workflow.getWorkflowsFor(self):
            state = api.get_workflow_status_of(self, w.state_var)
            states[w.state_var] = state
        return states
592260
def _validate(self):
        
        if self.data_format is FormatType.PYTHON:
            self.data = self.raw_data
        elif self.data_format is FormatType.JSON:
            self._validate_json()
        elif self.data_format is FormatType.YAML:
            self._validate_yaml()
236106
def steps(self, start, end):
        
        if not 0 <= start <= 1:
            raise ValueError('Values must be between 0 and 1.')
        if not 0 <= end <= 1:
            raise ValueError('Values must be between 0 and 1.')

        raw_start = self._to_single_raw_pwm(start)
        raw_end = self._to_single_raw_pwm(end)
        return abs(raw_start - raw_end)
924684
def workflow_validate_batch(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/validateBatch' % object_id, input_params, always_retry=always_retry, **kwargs)
1112410
def _validate_columns(self):
        '''
        
        '''
        for column_index in range(self.start[1], self.end[1]):
            table_column = TableTranspose(self.table)[column_index]

            column_type = None
            if self.end[0] > self.start[0]:
                column_type = get_cell_type(table_column[self.start[0]])

            num_type_changes = 0
            for row_index in range(self.start[0], self.end[0]):
                if not check_cell_type(table_column[row_index], column_type):
                    column_type = get_cell_type(table_column[row_index])
                    num_type_changes += 1
                if num_type_changes > 1:
                    self.flag_change(self.flags, 'warning', (row_index-1, column_index),
                                     self.worksheet, self.FLAGS['unexpected-change'])
                    # Decrement this to catch other cells which change again
                    num_type_changes -= 1
512466
def _assemble_and_send_validation_request(self):
        

        # Fire off the query.
        return self.client.service.validateShipment(
                WebAuthenticationDetail=self.WebAuthenticationDetail,
                ClientDetail=self.ClientDetail,
                TransactionDetail=self.TransactionDetail,
                Version=self.VersionId,
                RequestedShipment=self.RequestedShipment)