code: def _calendar_month_middles(year):
      
      # remove mdays[0] since January starts at mdays[1]
      # make local copy of mdays since we need to change
      # February for leap years
      mdays = np.array(calendar.mdays[1:])
      ydays = 365
      # handle leap years
      if calendar.isleap(year):
          mdays[1] = mdays[1] + 1
          ydays = 366
      middles = np.concatenate(
          [[-calendar.mdays[-1] / 2.0],  # Dec last year
           np.cumsum(mdays) - np.array(mdays) / 2.,  # this year
           [ydays + calendar.mdays[1] / 2.0]])  # Jan next year
      return middles
docs: List of middle day of each month, used by Linke turbidity lookup