code: def first_kday(k, gyear, gmonth, gday):
      r"""Calculate the first kday in RDate format.
  
      Parameters
      ----------
      k : int
          Day of the week.
      gyear : int
          Gregorian year.
      gmonth : int
          Gregorian month.
      gday : int
          Gregorian day.
  
      Returns
      -------
      fkd : int
          first-kday in RDate format.
      """
      fkd = nth_kday(1, k, gyear, gmonth, gday)
      return fkd
  
imports: import calendar
  import logging
  import math
  import pandas
label_desc: Use image node_id 7 for calling a global function with example usage: first_kday(k, gyear, gmonth, gday) and returns: fkd