code: def new_years_day(gyear, observed):
      r"""Get New Year's day for a given year.
  
      Parameters
      ----------
      gyear : int
          Gregorian year.
      observed : bool
          False if the exact date, True if the weekday.
  
      Returns
      -------
      nyday : int
          New Year's Day in RDate format.
      """
      nyday = gdate_to_rdate(gyear, 1, 1)
      if observed and day_of_week(nyday) == 0:
          nyday += 1
      return nyday
  
imports: import calendar
  import logging
  import math
  import pandas
label_desc: Use image node_id 28 for calling a global function with example usage: new_years_day(gyear, observed) and returns: nyday