code: def test_both_impls(test_fn):
      # Decorator to run the test with both BoundedHolidayCalendar and
      # UnboundedHolidayCalendar.
      # Create the calendar as `self.impl(args)`.
      def create_unbounded_calendar(**kwargs):
          kwargs.pop("start_year", None)
          kwargs.pop("end_year", None)
          return unbounded_holiday_calendar.UnboundedHolidayCalendar(
              **kwargs
          )
  
      @functools.wraps(test_fn)
      def wrapped(*args, **kwargs):
          self = args[0]
          with self.subTest("Bounded"):
              self.impl = (
                  bounded_holiday_calendar.BoundedHolidayCalendar
              )
              test_fn(*args, **kwargs)
          with self.subTest("Unbounded"):
              self.impl = create_unbounded_calendar
              test_fn(*args, **kwargs)
  
      return wrapped
  
imports: import datetime
  import functools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tf_quant_finance.datetime import bounded_holiday_calendar
  from tf_quant_finance.datetime import test_data
  from tf_quant_finance.datetime import unbounded_holiday_calendar
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling a global function with example usage: test_both_impls(test_fn) and returns: wrapped, unbounded_holiday_calendar