code: def biz_day_week(rdate):
      r"""Calculate the business day of the week.
  
      Parameters
      ----------
      rdate : int
          RDate date format.
  
      Returns
      -------
      bdw : int
          Business day of week.
      """
  
      gyear, _, _ = rdate_to_gdate(rdate)
      dw = day_of_week(rdate)
      week_day = dw >= 1 and dw <= 5
  
      bdw = 0
      if week_day:
          rdate1 = rdate - dw + 1
          rdate2 = rdate - 1
          holidays = set_holidays(gyear, True)
          for h in holidays:
              holiday = holidays[h]
              in_period = holiday >= rdate1 and holiday <= rdate2
              if in_period:
                  bdw -= 1
      return bdw
  
imports: import calendar
  import logging
  import math
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: biz_day_week(rdate) and returns: bdw