def get_host_port(spec, default_port):
 args = (spec.split(':', 1) + [default_port])[:2]
 args[1] = int(args[1])
 return (args[0], args[1])

def get_host_port ( spec , default_port ) : args = ( spec . split ( ':' , 1 ) + [ default_port ] ) [ : 2 ] args [ 1 ] = int ( args [ 1 ] ) return ( args [ 0 ] , args [ 1 ] )
parse hostname:22 into a host and port .