code: def intensity_measure_types(value):
      
      imts = []
      for chunk in value.split(','):
          imts.append(imt.from_string(chunk.strip()))
      sorted_imts = sorted(imts, key=lambda im: getattr(im, 'period', 1))
      if len(distinct(imts)) < len(imts):
          raise ValueError('Duplicated IMTs in %s' % value)
      if sorted_imts != imts:
          raise ValueError('The IMTs are not sorted by period: %s' % value)
      return [str(imt) for imt in imts]
docs: :param value: input string
      :returns: non-empty list of Intensity Measure Type objects
  
      >>> intensity_measure_types('PGA')
      ['PGA']
      >>> intensity_measure_types('PGA, SA(1.00)')
      ['PGA', 'SA(1.0)']
      >>> intensity_measure_types('SA(0.1), SA(0.10)')
      Traceback (most recent call last):
        ...
      ValueError: Duplicated IMTs in SA(0.1), SA(0.10)
      >>> intensity_measure_types('SA(1), PGA')
      Traceback (most recent call last):
      ...
      ValueError: The IMTs are not sorted by period: SA(1), PGA