code: def maximum_distance(value):
      
      dic = floatdict(value)
      for trt, magdists in dic.items():
          if isinstance(magdists, list):  # could be a scalar otherwise
              magdists.sort()  # make sure the list is sorted by magnitude
              for mag, dist in magdists:  # validate the magnitudes
                  magnitude(mag)
      return IntegrationDistance(dic)
docs: :param value:
          input string corresponding to a valid maximum distance
      :returns:
          a IntegrationDistance mapping