<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def linkage_group_ordering(linkage_records):
 """Convert degenerate linkage records into ordered info_frags-like records for comparison purposes. Simple example: Each key of the record is a newly-formed 'scaffold' (linkage group):
 ['linkage_group_1', 'linkage_group_2', 'linkage_group_3'] Records are in the form [init_contig, frag_id, start, end, orientation]. Since fragment ids are meaningless in non-HiC contexts a negative identifier is set so it is understood that region was added due to linkage data (-1 is for recovering data after first-pass polishing and -2 is for sequence insertions after long read based polishing). [['sctg_207', -3, 31842, 94039, 1], ['sctg_207', -3, 95303, 95303, 1]] [['sctg_308', -3, 15892, 25865, 1], ['sctg_486', -3, 41893, 41893, 1]] Orientations are always set to 1 by default. [['sctg_516', -3, 36614, 50582, 1]] """


    new_records = dict()

    for lg_name, linkage_group in itertools.groupby(
        linkage_records, operator.itemgetter(0)
    ):
        new_records[lg_name] = []
        for record in linkage_group:
            init_contig = record[-1]
            start = record[1]
            end = record[2]

            new_record = [init_contig, -3, start, end, 1]

            new_records[lg_name].append(new_record)

    return new_records