code: def _resolve_calendar_boundaries(holidays, start_year, end_year):
      if holidays is None or holidays.shape.num_elements() in [None, 0]:
          if start_year is None or end_year is None:
              raise ValueError(
                  "Please specify either holidays or both start_year and "
                  "end_year arguments"
              )
          return start_year, end_year
  
      return tf.math.reduce_min(holidays.year()), tf.math.reduce_max(
          holidays.year()
      )
  
imports: import attr
  import tensorflow.compat.v2
  from tf_quant_finance.datetime import constants
  from tf_quant_finance.datetime import date_tensor
  from tf_quant_finance.datetime import holiday_calendar
  from tf_quant_finance.datetime import periods
label_desc: Use image node_id 1 for calling a global function with example usage: _resolve_calendar_boundaries(holidays, start_year, end_year) and returns: tf,  tf, start_year,  end_year