code: def key_period_size(period):
      
  
      unit, start, size = period
  
      return '{}_{}'.format(unit_weight(unit), size)
docs: Defines a key in order to sort periods by length. It uses two aspects : first unit then size
  
      :param period: an OpenFisca period
      :return: a string
  
      >>> key_period_size(period('2014'))
      '2_1'
      >>> key_period_size(period('2013'))
      '2_1'
      >>> key_period_size(period('2014-01'))
      '1_1'