def localhost():
 global _localhost
 if (_localhost is None):
  _localhost = socket.gethostbyname('localhost')
 return _localhost

def localhost ( ) : global _localhost if ( _localhost is None ) : _localhost = socket . gethostbyname ( 'localhost' ) return _localhost
return the ip address of the magic hostname localhost .