code: def test_OncePerDay(self):
      class RuleCounter(StatefulRule):
          """
          A rule that counts the number of times another rule triggers
          but forwards the results out.
          """
  
          count = 0
  
          def should_trigger(self, dt):
              st = self.rule.should_trigger(dt)
              if st:
                  self.count += 1
              return st
  
      for minute_group in minutes_for_days(self.cal):
          rule = RuleCounter(OncePerDay())
  
          for minute in minute_group:
              rule.should_trigger(minute)
  
          self.assertEqual(rule.count, 1)
  
imports: import datetime
  from inspect import isabstract
  import random
  from unittest import TestCase
  import warnings
  from nose_parameterized import parameterized
  import pandas
  from six import iteritems
  from six.moves import range, map
  import catalyst.utils.events
  from catalyst.utils.calendars import get_calendar
  from catalyst.utils.events import EventRule, StatelessRule, Always, Never, AfterOpen, ComposedRule, BeforeClose, NotHalfDay, NthTradingDayOfWeek, NDaysBeforeLastTradingDayOfWeek, NthTradingDayOfMonth, NDaysBeforeLastTradingDayOfMonth, StatefulRule, OncePerDay, _build_offset, _build_date, _build_time, EventManager, Event, MAX_MONTH_RANGE, MAX_WEEK_RANGE, TradingDayOfMonthRule, TradingDayOfWeekRule
label_desc: Use image node_id 2 for calling the StatefulRulesTests obj's underlying member method code with example usage: obj.test_OncePerDay() and returns: st