def _pretty_hex(hex_str):
 if ((len(hex_str) % 2) != 0):
  hex_str = ('0' + hex_str)
 return ':'.join([hex_str[i:(i + 2)] for i in range(0, len(hex_str), 2)]).upper()

def _pretty_hex ( hex_str ) : if ( ( len ( hex_str ) % 2 ) != 0 ) : hex_str = ( '0' + hex_str ) return ':' . join ( [ hex_str [ i : ( i + 2 ) ] for i in range ( 0 , len ( hex_str ) , 2 ) ] ) . upper ( )
nicely formats hex strings .