<s> import os <EOL> import sys <EOL> import time <EOL> import imp <EOL> import socket <EOL> knownPlatforms = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> _timeFunctions = { <EOL> '<STR_LIT>' : time . time , <EOL> } <EOL> class Platform : <EOL> """<STR_LIT>""" <EOL> name = os . name <EOL> type = knownPlatforms . get ( os . name ) <EOL> seconds = staticmethod ( _timeFunctions . get ( type , time . time ) ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' . format ( self . type , self . name ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' . format ( self . __class__ . __name__ , self ) <EOL> def isKnown ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . type is not None <EOL> def getType ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . type <EOL> @ property <EOL> def is_posix ( self ) : <EOL> return self . type == '<STR_LIT>' <EOL> @ property <EOL> def isMacOSX ( self ) : <EOL> """<STR_LIT>""" <EOL> return sys . platform == "<STR_LIT>" <EOL> @ property <EOL> def is_winNT ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . getType ( ) == '<STR_LIT>' : <EOL> import _winreg <EOL> try : <EOL> k = _winreg . OpenKeyEx ( <EOL> _winreg . HKEY_LOCAL_MACHINE , <EOL> r'<STR_LIT>' ) <EOL> _winreg . QueryValueEx ( k , '<STR_LIT>' ) <EOL> return True <EOL> except WindowsError : <EOL> return False <EOL> return False <EOL> @ property <EOL> def is_windows ( self ) : <EOL> return self . getType ( ) == '<STR_LIT>' <EOL> def supportsThreads ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return imp . find_module ( '<STR_LIT>' ) [ <NUM_LIT:0> ] is None <EOL> except ImportError : <EOL> return False <EOL> @ property <EOL> def has_multiProcessSocket ( self ) : <EOL> '''<STR_LIT>''' <EOL> return hasattr ( socket , '<STR_LIT>' ) </s>
