code: def _check_period_consistency(self, period, variable):
          
          if variable.definition_period == periods.ETERNITY:
              return  # For variables which values are constant in time, all periods are accepted
  
          if variable.definition_period == periods.MONTH and period.unit != periods.MONTH:
              raise ValueError("Unable to compute variable '{0}' for period {1}: '{0}' must be computed for a whole month. You can use the ADD option to sum '{0}' over the requested period, or change the requested period to 'period.first_month'.".format(
                  variable.name,
                  period
                  ))
  
          if variable.definition_period == periods.YEAR and period.unit != periods.YEAR:
              raise ValueError("Unable to compute variable '{0}' for period {1}: '{0}' must be computed for a whole year. You can use the DIVIDE option to get an estimate of {0} by dividing the yearly value by 12, or change the requested period to 'period.this_year'.".format(
                  variable.name,
                  period
                  ))
  
          if period.size != 1:
              raise ValueError("Unable to compute variable '{0}' for period {1}: '{0}' must be computed for a whole {2}. You can use the ADD option to sum '{0}' over the requested period.".format(
                  variable.name,
                  period,
                  'month' if variable.definition_period == periods.MONTH else 'year'
                  ))
docs: Check that a period matches the variable definition_period