def ordered_yaml(cfg):
    order = ['name', 'model_type', 'segmentation_col', 'fit_filters',
             'predict_filters',
             'choosers_fit_filters', 'choosers_predict_filters',
             'alts_fit_filters', 'alts_predict_filters',
             'interaction_predict_filters',
             'choice_column', 'sample_size', 'estimation_sample_size',
             'prediction_sample_size',
             'model_expression', 'ytransform', 'min_segment_size',
             'default_config', 'models', 'coefficients', 'fitted']

    s = []
    for key in order:
        if key not in cfg:
            continue
        s.append(
            yaml.dump({key: cfg[key]}, default_flow_style=False, indent=4))

    for key in cfg:
        if key in order:
            continue
        s.append(
            yaml.dump({key: cfg[key]}, default_flow_style=False, indent=4))

    return os.linesep.join(s)
Generate two OAuth safe sha1 hashes
dataset/ETHPy150Open UDST/urbansim/urbansim/utils/yamlio.py/ordered_yaml--crossover with--dataset/ETHPy150Open honza/oauth-service/fabfile.py/oauth