def format_data(raw_data, limit_per_url_group=LIMIT_PER_URL_GROUP, limit_url_groups=LIMIT_URL_GROUPS):
    data = copy.deepcopy(raw_data)
    for k, v in data['data_details'].items():
        # Only reserve first ``limit_per_url_group`` items
        v['urls'] = sorted(v['urls'].iteritems(), key=lambda (k, v): v.total,
                           reverse=True)[:limit_per_url_group]

    data_details = sorted(data['data_details'].iteritems(),
                          key=lambda (k, v): v["duration_agr_data"].total, 
                          reverse=True)[:limit_url_groups]

    if data['requests_counter']['normal']:
        slow_rate = format(data['requests_counter']['slow'] / \
                           float(data['requests_counter']['normal']), '.2%')
    else:
        slow_rate = '-'
    data.update({
        'slow_rate': slow_rate,
        'data_details': data_details,
    })
    return data
Creates a point layer from vertices in a line layer.
dataset/ETHPy150Open piglei/uwsgi-sloth/uwsgi_sloth/analyzer.py/format_data--crossover with--dataset/ETHPy150Open cgarrard/osgeopy-code/Chapter6/listing6_1.py/line_to_point_layer