code: def _state(self, variable, num):
          
  
          value = getattr(self, variable)
  
          if value is None:
              return False
  
          if value is True:
              return True
  
          if random.randint(1, num) == num:
              setattr(self, variable, True)
              return True
  
          return False
docs: Generic method to randomly determine if state is reached