def _GetDayOfYear(self, year, month, day_of_month):
if month not in range(<NUM_LIT:1>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>days_per_month = self._GetDaysPerMonth(year, month)<EOL>if day_of_month < <NUM_LIT:1> or day_of_month > days_per_month:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>day_of_year = day_of_month<EOL>for past_month in range(<NUM_LIT:1>, month):<EOL><INDENT>day_of_year += self._GetDaysPerMonth(year, past_month)<EOL><DEDENT>return day_of_year<EOL>
Retrieves the day of the year for a specific day of a month in a year.

        Args:
          year (int): year e.g. 1970.
          month (int): month, where 1 represents January.
          day_of_month (int): day of the month, where 1 represents the first day.

        Returns:
          int: day of year.

        Raises:
          ValueError: if the month or day of month value is out of bounds.