class_docstr: Generates schedules containing every business day in a period.
docstr: Initializes the schedule.
  
  Initializes a schedule with a given date range and holiday calendar.
  
  The schedule includes all business days between and including `start_date`
  and `end_date`.
  
  Can create multiple schedules simultaneously. The start and end dates may
  have any (compatible) shape. The `DateTensor` returned by `dates()` has the
  shape `start_date.shape + (n,)`, where `n` is the maximum length of
  schedules in the batch. If schedules have different lengths, the extra
  elements will be padded with extra `end_date` elements at the end, if
  `backward=False` and with extra `start_date` elements in the beginning if
  `backward=True`. In all cases each schedule in the batch is monotonic.
  
  #### Example Usage (Non-batch)
  
  ```python
    start_date = datetime.dates_from_tuples([(2020, 3, 19)])
    end_date = datetime.dates_from_tuples([(2021, 3, 25)])
    holiday_calendar = datetime.HolidayCalendar(start_year=2020,
                                                end_year=2021)
    schedule = datetime.BusinessDaysSchedule(
        start_date=start_date,
        end_date=end_date,
        holiday_calendar=holiday_calendar,
        roll_convention=datetime.BusinessDayConvention.FOLLOWING,
        backward=False).dates()
    # schedule is a DateTensor of
    # [[(2020, 3, 19), (2020, 3, 20), (2020, 3, 23), (2020, 3, 24),
    #   (2021, 3, 25)]] regardless of `backward`.
  ```
  
  #### Example Usage (Batch)
  
  ```python
    start_date = datetime.dates_from_tuples([(2020, 3, 19), (2020, 4, 15)])
    end_date = datetime.dates_from_tuples([(2021, 3, 13), (2021, 3, 17)])
    schedule = datetime.BusinessDaysSchedule(
        start_dates,
        end_dates,
        datetime.HolidayCalendar(start_year=2020, end_year=2021),
        backward=False).dates()
    # Returns DateTensor of
    # [[(2020, 3, 19), (2020, 3, 20), (2020, 3, 23), (2020, 3, 24),
    #   (2021, 3, 25)],
    # [(2020, 3, 13), (2020, 3, 16), (2020, 3, 17), (2020, 3, 17),
    #  (2021, 3, 17)]], if `backward` is True.
    # [[(2020, 3, 19), (2020, 3, 20), (2020, 3, 23), (2020, 3, 24),
    #   (2021, 3, 25)],
    # [(2020, 3, 13), (2020, 3, 13), (2020, 3, 13), (2020, 3, 16),
    #  (2021, 3, 17)]], if `backward` is True.
  ```
  Args:
    start_date: `dates.DateTensor`. Defines the lower boundary of schedule. If
      `backward=True` must be broadcastable to `end_date`, otherwise has
      arbitrary shape.
    end_date: `dates.DateTensor`. Defines the upper boundary of the schedule.
      If `backward=False` must be broadcastable to `start_date`, otherwise has
      arbitrary shape.
    holiday_calendar: `dates.HolidayCalendar` that defines which days will be
      included.
    backward: Python `bool`. Defines the way padding is applied in case of
      batching. If schedules in a batch have different lengths, the extra
      elements will be padded with extra `end_date` elements at the end, if
      `backward=False` and with extra `start_date` elements in the beginning
      if `backward=True`.
docstr_tok: ["Initializes","the","schedule",".","Initializes","a","schedule","with","a","given","date","range","and","holiday","calendar",".","The","schedule","includes","all","business","days","between","and","including","`","start_date","`","and","`","end_date","`",".","Can","create","multiple","schedules","simultaneously",".","The","start","and","end","dates","may","have","any","(","compatible",")","shape",".","The","`","DateTensor","`","returned","by","`","dates","(",")","`","has","the","shape","`","start_date.shape","+","(","n",",",")","`",",","where","`","n","`","is","the","maximum","length","of","schedules","in","the","batch",".","If","schedules","have","different","lengths",",","the","extra","elements","will","be","padded","with","extra","`","end_date","`","elements","at","the","end",",","if","`","backward=False","`","and","with","extra","`","start_date","`","elements","in","the","beginning","if","`","backward=True","`",".","In","all","cases","each","schedule","in","the","batch","is","monotonic",".","#","#","#","#","Example","Usage","(","Non-batch",")","``","`","python","start_date","=","datetime.dates_from_tuples","(","[","(","2020",",","3",",","19",")","]",")","end_date","=","datetime.dates_from_tuples","(","[","(","2021",",","3",",","25",")","]",")","holiday_calendar","=","datetime.HolidayCalendar","(","start_year=2020",",","end_year=2021",")","schedule","=","datetime.BusinessDaysSchedule","(","start_date=start_date",",","end_date=end_date",",","holiday_calendar=holiday_calendar",",","roll_convention=datetime.BusinessDayConvention.FOLLOWING",",","backward=False",")",".dates","(",")","#","schedule","is","a","DateTensor","of","#","[","[","(","2020",",","3",",","19",")",",","(","2020",",","3",",","20",")",",","(","2020",",","3",",","23",")",",","(","2020",",","3",",","24",")",",","#","(","2021",",","3",",","25",")","]","]","regardless","of","`","backward","`",".","``","`","#","#","#","#","Example","Usage","(","Batch",")","``","`","python","start_date","=","datetime.dates_from_tuples","(","[","(","2020",",","3",",","19",")",",","(","2020",",","4",",","15",")","]",")","end_date","=","datetime.dates_from_tuples","(","[","(","2021",",","3",",","13",")",",","(","2021",",","3",",","17",")","]",")","schedule","=","datetime.BusinessDaysSchedule","(","start_dates",",","end_dates",",","datetime.HolidayCalendar","(","start_year=2020",",","end_year=2021",")",",","backward=False",")",".dates","(",")","#","Returns","DateTensor","of","#","[","[","(","2020",",","3",",","19",")",",","(","2020",",","3",",","20",")",",","(","2020",",","3",",","23",")",",","(","2020",",","3",",","24",")",",","#","(","2021",",","3",",","25",")","]",",","#","[","(","2020",",","3",",","13",")",",","(","2020",",","3",",","16",")",",","(","2020",",","3",",","17",")",",","(","2020",",","3",",","17",")",",","#","(","2021",",","3",",","17",")","]","]",",","if","`","backward","`","is","True",".","#","[","[","(","2020",",","3",",","19",")",",","(","2020",",","3",",","20",")",",","(","2020",",","3",",","23",")",",","(","2020",",","3",",","24",")",",","#","(","2021",",","3",",","25",")","]",",","#","[","(","2020",",","3",",","13",")",",","(","2020",",","3",",","13",")",",","(","2020",",","3",",","13",")",",","(","2020",",","3",",","16",")",",","#","(","2021",",","3",",","17",")","]","]",",","if","`","backward","`","is","True",".","``","`","Args",":","start_date",":","`","dates.DateTensor","`",".","Defines","the","lower","boundary","of","schedule",".","If","`","backward=True","`","must","be","broadcastable","to","`","end_date","`",",","otherwise","has","arbitrary","shape",".","end_date",":","`","dates.DateTensor","`",".","Defines","the","upper","boundary","of","the","schedule",".","If","`","backward=False","`","must","be","broadcastable","to","`","start_date","`",",","otherwise","has","arbitrary","shape",".","holiday_calendar",":","`","dates.HolidayCalendar","`","that","defines","which","days","will","be","included",".","backward",":","Python","`","bool","`",".","Defines","the","way","padding","is","applied","in","case","of","batching",".","If","schedules","in","a","batch","have","different","lengths",",","the","extra","elements","will","be","padded","with","extra","`","end_date","`","elements","at","the","end",",","if","`","backward=False","`","and","with","extra","`","start_date","`","elements","in","the","beginning","if","`","backward=True","`","."]
code: def __init__(
      self, *, start_date, end_date, holiday_calendar, backward=False
  ):
      """Initializes the schedule.
  
      Initializes a schedule with a given date range and holiday calendar.
  
      The schedule includes all business days between and including `start_date`
      and `end_date`.
  
      Can create multiple schedules simultaneously. The start and end dates may
      have any (compatible) shape. The `DateTensor` returned by `dates()` has the
      shape `start_date.shape + (n,)`, where `n` is the maximum length of
      schedules in the batch. If schedules have different lengths, the extra
      elements will be padded with extra `end_date` elements at the end, if
      `backward=False` and with extra `start_date` elements in the beginning if
      `backward=True`. In all cases each schedule in the batch is monotonic.
  
      #### Example Usage (Non-batch)
  
      ```python
        start_date = datetime.dates_from_tuples([(2020, 3, 19)])
        end_date = datetime.dates_from_tuples([(2021, 3, 25)])
        holiday_calendar = datetime.HolidayCalendar(start_year=2020,
                                                    end_year=2021)
        schedule = datetime.BusinessDaysSchedule(
            start_date=start_date,
            end_date=end_date,
            holiday_calendar=holiday_calendar,
            roll_convention=datetime.BusinessDayConvention.FOLLOWING,
            backward=False).dates()
        # schedule is a DateTensor of
        # [[(2020, 3, 19), (2020, 3, 20), (2020, 3, 23), (2020, 3, 24),
        #   (2021, 3, 25)]] regardless of `backward`.
      ```
  
      #### Example Usage (Batch)
  
      ```python
        start_date = datetime.dates_from_tuples([(2020, 3, 19), (2020, 4, 15)])
        end_date = datetime.dates_from_tuples([(2021, 3, 13), (2021, 3, 17)])
        schedule = datetime.BusinessDaysSchedule(
            start_dates,
            end_dates,
            datetime.HolidayCalendar(start_year=2020, end_year=2021),
            backward=False).dates()
        # Returns DateTensor of
        # [[(2020, 3, 19), (2020, 3, 20), (2020, 3, 23), (2020, 3, 24),
        #   (2021, 3, 25)],
        # [(2020, 3, 13), (2020, 3, 16), (2020, 3, 17), (2020, 3, 17),
        #  (2021, 3, 17)]], if `backward` is True.
        # [[(2020, 3, 19), (2020, 3, 20), (2020, 3, 23), (2020, 3, 24),
        #   (2021, 3, 25)],
        # [(2020, 3, 13), (2020, 3, 13), (2020, 3, 13), (2020, 3, 16),
        #  (2021, 3, 17)]], if `backward` is True.
      ```
      Args:
        start_date: `dates.DateTensor`. Defines the lower boundary of schedule. If
          `backward=True` must be broadcastable to `end_date`, otherwise has
          arbitrary shape.
        end_date: `dates.DateTensor`. Defines the upper boundary of the schedule.
          If `backward=False` must be broadcastable to `start_date`, otherwise has
          arbitrary shape.
        holiday_calendar: `dates.HolidayCalendar` that defines which days will be
          included.
        backward: Python `bool`. Defines the way padding is applied in case of
          batching. If schedules in a batch have different lengths, the extra
          elements will be padded with extra `end_date` elements at the end, if
          `backward=False` and with extra `start_date` elements in the beginning
          if `backward=True`.
      """
      self._start_date = start_date
      self._end_date = end_date
      self._holiday_calendar = holiday_calendar
      self._backward = backward
  
imports: import tensorflow.compat.v2
  from tf_quant_finance.datetime import constants
  from tf_quant_finance.datetime import date_tensor
label_desc: Use image node_id 1 to create a new BusinessDaySchedule object  with example: obj = BusinessDaySchedule()