def host_format(s, host=None, name=None, **extra):
 host = (host or gethostname())
 (hname, _, domain) = host.partition(u'.')
 name = (name or hname)
 keys = dict({u'h': host, u'n': name, u'd': domain, u'i': _fmt_process_index, u'I': _fmt_process_index_with_prefix}, **extra)
 return simple_format(s, keys)

def host_format ( s , host = None , name = None , ** extra ) : host = ( host or gethostname ( ) ) ( hname , _ , domain ) = host . partition ( u'.' ) name = ( name or hname ) keys = dict ( { u'h' : host , u'n' : name , u'd' : domain , u'i' : _fmt_process_index , u'I' : _fmt_process_index_with_prefix } , ** extra ) return simple_format ( s , keys )
format host %x abbreviations .