Time-step at which this intervention occurs, starting from 0, the first intervention-period time-step.
        https://github.com/SwissTPH/openmalaria/wiki/GeneratedSchema32Doc#-deploy-1
        rtype: list
770179
def timesteps(self):
        
        timesteps = []
        timed = self.et.find("timed")

        if timed is not None:
            for deploy in timed.findall("deploy"):
                timesteps.append(deploy.attrib["time"])

        return timesteps
821737
def first(self):
        
        results = self.rpc_model.search_read(
            self.domain, None, 1, self._order_by, self.fields,
            context=self.context
        )
        return results and results[0] or None
526395
def run(self, steps=float('inf')):
        

        self.running = True
        activation = None
        execution = 0
        while steps > 0 and self.running:

            added, removed = self.get_activations()
            self.strategy.update_agenda(self.agenda, added, removed)

            if watchers.worth('AGENDA', 'DEBUG'):  # pragma: no cover
                for idx, act in enumerate(self.agenda.activations):
                    watchers.AGENDA.debug(
                        "%d: %r %r",
                        idx,
                        act.rule.__name__,
                        ", ".join(str(f) for f in act.facts))

            activation = self.agenda.get_next()

            if activation is None:
                break
            else:
                steps -= 1
                execution += 1

                watchers.RULES.info(
                    "FIRE %s %s: %s",
                    execution,
                    activation.rule.__name__,
                    ", ".join(str(f) for f in activation.facts))

                activation.rule(
                    self,
                    **{k: v
                       for k, v in activation.context.items()
                       if not k.startswith('__')})

        self.running = False
1018735
def resolve_one_step(self):
        
        metamodel = self.parser.metamodel

        current_crossrefs = self.parser._crossrefs
        # print("DEBUG: Current crossrefs #: {}".
        #      format(len(current_crossrefs)))
        new_crossrefs = []
        self.delayed_crossrefs = []
        resolved_crossref_count = 0

        # -------------------------
        # start of resolve-loop
        # -------------------------
        default_scope = DefaultScopeProvider()
        for obj, attr, crossref in current_crossrefs:
            if (get_model(obj) == self.model):
                attr_value = getattr(obj, attr.name)
                attr_refs = [obj.__class__.__name__ + "." + attr.name,
                             "*." + attr.name, obj.__class__.__name__ + ".*",
                             "*.*"]
                for attr_ref in attr_refs:
                    if attr_ref in metamodel.scope_providers:
                        if self.parser.debug:
                            self.parser.dprint(" FOUND {}".format(attr_ref))
                        resolved = metamodel.scope_providers[attr_ref](
                            obj, attr, crossref)
                        break
                else:
                    resolved = default_scope(obj, attr, crossref)

                # Collect cross-references for textx-tools
                if resolved and not type(resolved) is Postponed:
                    if metamodel.textx_tools_support:
                        self.pos_crossref_list.append(
                            RefRulePosition(
                                name=crossref.obj_name,
                                ref_pos_start=crossref.position,
                                ref_pos_end=crossref.position + len(
                                    resolved.name),
                                def_pos_start=resolved._tx_position,
                                def_pos_end=resolved._tx_position_end))

                if not resolved:
                    # As a fall-back search builtins if given
                    if metamodel.builtins:
                        if crossref.obj_name in metamodel.builtins:
                            # TODO: Classes must match
                            resolved = metamodel.builtins[crossref.obj_name]

                if not resolved:
                    line, col = self.parser.pos_to_linecol(crossref.position)
                    raise TextXSemanticError(
                        message='Unknown object "{}" of class "{}"'.format(
                            crossref.obj_name, crossref.cls.__name__),
                        line=line, col=col, err_type=UNKNOWN_OBJ_ERROR,
                        expected_obj_cls=crossref.cls,
                        filename=self.model._tx_filename)

                if type(resolved) is Postponed:
                    self.delayed_crossrefs.append((obj, attr, crossref))
                    new_crossrefs.append((obj, attr, crossref))
                else:
                    resolved_crossref_count += 1
                    if attr.mult in [MULT_ONEORMORE, MULT_ZEROORMORE]:
                        attr_value.append(resolved)
                    else:
                        setattr(obj, attr.name, resolved)
            else:  # crossref not in model
                new_crossrefs.append((obj, attr, crossref))
        # -------------------------
        # end of resolve-loop
        # -------------------------
        # store cross-refs from other models in the parser list (for later
        # processing)
        self.parser._crossrefs = new_crossrefs
        # print("DEBUG: Next crossrefs #: {}".format(len(new_crossrefs)))
        return (resolved_crossref_count, self.delayed_crossrefs)
503709
def _getMyFirstDatetimeFrom(self):
        
        myStartDt = getAwareDatetime(self.repeat.dtstart, None,
                                     self.tz, dt.time.min)
        return self.__after(myStartDt, excludeCancellations=False)
750952
def begin(self):
    """"""
    self._global_step_tensor = tf.train.get_global_step()
    if self._global_step_tensor is None:
      raise RuntimeError(
          'Global step should be created to use StepCounterHook.')
663454
def update(self, dt=-1):
        
        self.library.update.argtypes = [c_double]
        self.library.update.restype = c_int
        if dt == -1:
            # use default timestep
            dt = self.get_time_step()
        result = wrap(self.library.update)(dt)
        return result
229592
long getInitialDelay(long stepSize) {
    long now = clock().wallTime();
    long stepBoundary = now / stepSize * stepSize;

    // Buffer by 10% of the step interval on either side
    long offset = stepSize / 10;

    // Check if the current delay is within the acceptable range
    long delay = now - stepBoundary;
    if (delay < offset) {
      return delay + offset;
    } else if (delay > stepSize - offset) {
      return stepSize - offset;
    } else {
      return delay;
    }
  }
713210
def occurrence_at( time )
      real_duration = duration - 1

      range = [ time - real_duration, time ]

      start_time = proxy.occurrences_between( range[0], range[1] ).first
      end_time   = start_time + real_duration

      Occurrence.new start_time, real_duration, end_time
    end
607126
def next(self):
        
        # all agents acted, init next step
        t = time.time()
        if len(self._agents_to_act) == 0:
            self._init_step()

        addr = self._agents_to_act.pop(0)
        aiomas.run(until=self.env.trigger_act(addr=addr))
        t2 = time.time()
        self._step_processing_time += t2 - t

        # all agents acted, finalize current step
        if len(self._agents_to_act) == 0:
            self._finalize_step()
906369
def _get_earliest_valid_timestamp(self, symbol, interval):
        
        kline = self.get_klines(
            symbol=symbol,
            interval=interval,
            limit=1,
            startTime=0,
            endTime=None
        )
        return kline[0][0]
451926
def first_delayed(self):
        
        entries = self.delayed.zrange(0, 0, withscores=True)
        return entries[0] if entries else None
1227347
public void addStep(DeploymentOperationStep step) {
    if(currentStep != null) {
      steps.add(steps.indexOf(currentStep)+1, step);
    } else {
      steps.add(step);
    }
  }
707985
def add(self, intervention, id=None):
        
        if self.et is None:
            return

        assert isinstance(intervention, six.string_types)
        et = ElementTree.fromstring(intervention)
        component = None

        if et.find("ITN") is not None:
            component = ITN(et)
        elif et.find("GVI") is not None:
            component = GVI(et)
        elif et.find("MDA") is not None:
            component = MDA(et)
        elif et.find("TBV") is not None or et.find("PEV") is not None or et.find("BSV") is not None:
            component = Vaccine(et)
        else:
            return

        assert isinstance(component.name, six.string_types)

        if id is not None:
            assert isinstance(id, six.string_types)
            et.attrib["id"] = id

        index = len(self.et.findall("component"))
        self.et.insert(index, et)
717522
def _generate_time_steps(self, trajectory_list):
    """"""
    for time_step in env_problem.EnvProblem._generate_time_steps(
        self, trajectory_list):
      # Convert the rendered observations from numpy to png format.
      frame_np = np.array(time_step.pop(env_problem.OBSERVATION_FIELD))
      frame_np = frame_np.reshape(
          [self.frame_height, self.frame_width, self.num_channels])
      # TODO(msaffar) Add support for non RGB rendered environments
      frame = png.from_array(frame_np, "RGB", info={"bitdepth": 8})
      frame_buffer = six.BytesIO()
      frame.save(frame_buffer)

      # Put the encoded frame back.
      time_step[_IMAGE_ENCODED_FIELD] = [frame_buffer.getvalue()]
      time_step[_IMAGE_FORMAT_FIELD] = [_FORMAT]
      time_step[_IMAGE_HEIGHT_FIELD] = [self.frame_height]
      time_step[_IMAGE_WIDTH_FIELD] = [self.frame_width]

      # Add the frame number
      time_step[_FRAME_NUMBER_FIELD] = time_step[env_problem.TIMESTEP_FIELD]
      yield time_step
6109
def step( self ):
        
        if ( self._step is not None ):
            return self._step
        
        elif ( self.rulerType() == XChartRuler.Type.Number ):
            self._step = int((self.maximum() - self.minimum()) / 10.0)
        
        elif ( self.rulerType() == XChartRuler.Type.Date ):
            
            self._step = int(self.minimum().daysTo(self.maximum()) / 10.0) - 1
        
        elif ( self.rulerType() & (XChartRuler.Type.Time | \
                                   XChartRuler.Type.Datetime) ):
            self._step = int(self.minimum().secsTo(self.maximum()) / 10.0) - 1
        
        return self._step
1204898
private int getNextStep(int currentStep) {
        int nextStep = -1;
        
        // we find the next available step.
        for (int i = currentStep + 1; i <= STEP_THANKS; i++) {
            if(isStepEnabled(i)) {
                nextStep = i;
                break;
            }
        }

        return nextStep;
    }