def _use_relevance_feedback_restrict(self, reward: float) -> bool:
    """Returns true if restricts should be applied for the current step.

    Args:
      reward:  The reward used to determine if the restrict should be applied.
    Note: This uses a linear decay schedule for the moment but we may want to
      consider other strategies.
    """
    if (common_flags.RELEVANCE_FEEDBACK_RESTRICT.value == 1 and
        self.training and reward < 0):
      fraction_of_relevance_feedback_restricted_steps = max(
          0,
          common_flags.FRACTION_OF_RELEVANCE_FEEDBACK_RESTRICTED_STEPS.value
          -
          common_flags.FRACTION_OF_RELEVANCE_FEEDBACK_RESTRICTED_STEPS.value
          / common_flags.MAX_RELEVANCE_FEEDBACK_RESTRICTED_STEPS.value *
          self.training_steps)
      return random.random() < fraction_of_relevance_feedback_restricted_steps
    else:
      return False
Returns true if restricts should be applied for the current step.

    Args:
      reward:  The reward used to determine if the restrict should be applied.
    Note: This uses a linear decay schedule for the moment but we may want to
      consider other strategies.
    
language/search_agents/muzero/env.py