code: def day_of_year(gyear, gmonth, gday):
      r"""Calculate the day number of the given calendar year.
  
      Parameters
      ----------
      gyear : int
          Gregorian year.
      gmonth : int
          Gregorian month.
      gday : int
          Gregorian day.
  
      Returns
      -------
      dy : int
          Day number of year in RDate format.
      """
      dy = subtract_dates(gyear - 1, 12, 31, gyear, gmonth, gday)
      return dy
  
imports: import calendar
  import logging
  import math
  import pandas
label_desc: Use image node_id 5 for calling a global function with example usage: day_of_year(gyear, gmonth, gday) and returns: dy