def receiveds_format(receiveds):
log.debug("<STR_LIT>")<EOL>output = []<EOL>counter = Counter()<EOL>for i in receiveds[::-<NUM_LIT:1>]:<EOL><INDENT>j = {k: v.strip() for k, v in i.items() if v}<EOL>j["<STR_LIT>"] = counter["<STR_LIT>"] + <NUM_LIT:1><EOL>if i.get("<STR_LIT:date>"):<EOL><INDENT>i["<STR_LIT:date>"] = i["<STR_LIT:date>"].split("<STR_LIT:;>")[-<NUM_LIT:1>]<EOL>try:<EOL><INDENT>j["<STR_LIT>"], _ = convert_mail_date(i["<STR_LIT:date>"])<EOL><DEDENT>except TypeError:<EOL><INDENT>j["<STR_LIT>"] = None<EOL><DEDENT><DEDENT>size = len(output)<EOL>now = j.get("<STR_LIT>")<EOL>if size and now:<EOL><INDENT>before = output[counter["<STR_LIT>"] - <NUM_LIT:1>].get("<STR_LIT>")<EOL>if before:<EOL><INDENT>j["<STR_LIT>"] = (now - before).total_seconds()<EOL><DEDENT>else:<EOL><INDENT>j["<STR_LIT>"] = <NUM_LIT:0><EOL><DEDENT><DEDENT>else:<EOL><INDENT>j["<STR_LIT>"] = <NUM_LIT:0><EOL><DEDENT>output.append(j)<EOL>counter["<STR_LIT>"] += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>for i in output:<EOL><INDENT>if i.get("<STR_LIT>"):<EOL><INDENT>i["<STR_LIT>"] = i["<STR_LIT>"].isoformat()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return output<EOL><DEDENT><DEDENT>
Given a list of receiveds hop, adds metadata and reformat
field values

Args:
    receiveds (list): list of receiveds hops already formatted

Returns:
    list of receiveds reformated and with new fields