code: def prompt_with_prob(self, orig_response=None, prob=None):
          
          # Disable opt-out.
          # if self.assignment.cmd_args.no_experiments:
          #     log.info("Skipping prompt due to --no-experiments")
          #     return "Skipped due to --no-experiments"
          if self.load_error:
              return 'Failed to read guidance config file'
          if hasattr(self.assignment, 'is_test'):
              log.info("Skipping prompt due to test mode")
              return "Test response"
  
          if prob is None:
              prob = self.prompt_probability
  
          if random.random() > prob:
              log.info("Did not prompt for rationale: Insufficient Probability")
              return "Did not prompt for rationale"
          with format.block(style="-"):
              rationale = prompt.explanation_msg(EXPLANTION_PROMPT,
                                  short_msg=CONFIRM_BLANK_EXPLANATION)
  
          if prob is None:
              # Reduce future prompt likelihood
              self.prompt_probability = 0
          if orig_response:
              print('Thanks! Your original response was: {}'.format('\n'.join(orig_response)))
  
          return rationale
docs: Ask for rationale with a specific level of probability.