parameters: (
        self, current_times, step_number, state, raw_features,
        embedded_exogenous_regressors)
docstring: Performs a conditional state update based on exogenous features.
docstring_summary: Performs a conditional state update based on exogenous features.
docstring_tokens: Performs a conditional state update based on exogenous features .
function: def _apply_exogenous_update(
        self, current_times, step_number, state, raw_features,
        embedded_exogenous_regressors):
      """Performs a conditional state update based on exogenous features."""
      if embedded_exogenous_regressors is None:
        return state
      else:
        current_exogenous_regressors = embedded_exogenous_regressors[
            :, step_number, :]
        exogenous_updated_state = self._exogenous_input_step(
            current_times=current_times,
            current_exogenous_regressors=current_exogenous_regressors,
            state=state)
        if self._exogenous_update_condition is not None:
          current_raw_exogenous_features = {
              key: value[:, step_number] for key, value in raw_features.items()
              if key not in [PredictionFeatures.STATE_TUPLE,
                             TrainEvalFeatures.TIMES,
                             TrainEvalFeatures.VALUES]}
          conditionally_updated_state_flat = []
          for updated_state_element, original_state_element in zip(
              nest.flatten(exogenous_updated_state),
              nest.flatten(state)):
            conditionally_updated_state_flat.append(
                array_ops.where(
                    self._exogenous_update_condition(
                        times=current_times,
                        features=current_raw_exogenous_features),
                    updated_state_element,
                    original_state_element))
          return nest.pack_sequence_as(state, conditionally_updated_state_flat)
        else:
          return exogenous_updated_state
function_tokens: def _apply_exogenous_update ( self , current_times , step_number , state , raw_features , embedded_exogenous_regressors ) : if embedded_exogenous_regressors is None : return state else : current_exogenous_regressors = embedded_exogenous_regressors [ : , step_number , : ] exogenous_updated_state = self . _exogenous_input_step ( current_times = current_times , current_exogenous_regressors = current_exogenous_regressors , state = state ) if self . _exogenous_update_condition is not None : current_raw_exogenous_features = { key : value [ : , step_number ] for key , value in raw_features . items ( ) if key not in [ PredictionFeatures . STATE_TUPLE , TrainEvalFeatures . TIMES , TrainEvalFeatures . VALUES ] } conditionally_updated_state_flat = [ ] for updated_state_element , original_state_element in zip ( nest . flatten ( exogenous_updated_state ) , nest . flatten ( state ) ) : conditionally_updated_state_flat . append ( array_ops . where ( self . _exogenous_update_condition ( times = current_times , features = current_raw_exogenous_features ) , updated_state_element , original_state_element ) ) return nest . pack_sequence_as ( state , conditionally_updated_state_flat ) else : return exogenous_updated_state