def _GetNumberOfSecondsFromElements(<EOL>self, year, month, day_of_month, hours, minutes, seconds):
if not year or not month or not day_of_month:<EOL><INDENT>return None<EOL><DEDENT>if hours is None:<EOL><INDENT>hours = <NUM_LIT:0><EOL><DEDENT>elif hours not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(hours))<EOL><DEDENT>if minutes is None:<EOL><INDENT>minutes = <NUM_LIT:0><EOL><DEDENT>elif minutes not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(minutes))<EOL><DEDENT>if seconds is None:<EOL><INDENT>seconds = <NUM_LIT:0><EOL><DEDENT>elif seconds not in range(<NUM_LIT:0>, <NUM_LIT>):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(seconds))<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>time_elements_tuple = (year, month, day_of_month, hours, minutes, seconds)<EOL>number_of_seconds = calendar.timegm(time_elements_tuple)<EOL>return int(number_of_seconds)<EOL>
Retrieves the number of seconds from the date and time elements.

        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.
          hours (int): hours.
          minutes (int): minutes.
          seconds (int): seconds.

        Returns:
          int: number of seconds since January 1, 1970 00:00:00 or None if year,
              month or day of month are not set.

        Raises:
          ValueError: if the time elements are invalid.