def _canonicalize_experiment(exp):
    'Sorts the repeated fields of an Experiment message.'
    exp.hparam_infos.sort(key=operator.attrgetter('name'))
    exp.metric_infos.sort(key=operator.attrgetter('name.group', 'name.tag'))
    for hparam_info in exp.hparam_infos:
        if hparam_info.HasField('domain_discrete'):
            hparam_info.domain_discrete.values.sort(key=operator.attrgetter('string_value'))
Sorts the repeated fields of an Experiment message.
def _canonicalize_experiment(exp):
    
    exp.hparam_infos.sort(key=operator.attrgetter('name'))
    exp.metric_infos.sort(key=operator.attrgetter('name.group', 'name.tag'))
    for hparam_info in exp.hparam_infos:
        if hparam_info.HasField('domain_discrete'):
            hparam_info.domain_discrete.values.sort(key=operator.attrgetter('string_value'))