def check_mac(original_mac):
mac = (original_mac.upper()).strip()<EOL>parts = mac.split('<STR_LIT::>')<EOL>if len(parts) == <NUM_LIT:6>:<EOL><INDENT>for p in parts:<EOL><INDENT>if len(p) != <NUM_LIT:2>:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>mac = '<STR_LIT>'.join(parts)<EOL><DEDENT>elif len(parts) > <NUM_LIT:1>:<EOL><INDENT>return None<EOL><DEDENT>for c in mac:<EOL><INDENT>if c not in '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT><DEDENT>return mac<EOL>
Checks the format of a MAC address and returns it without double-colons and in capital letters, if it is correct. Otherwise it returns None.
* it accepts the format of the double colons and a single hex string