<s> import re <EOL> PORT = <NUM_LIT> <EOL> class XcodeServer ( object ) : <EOL> def __init__ ( self , host = None , port = PORT ) : <EOL> self . host = host <EOL> self . port = port <EOL> self . validate ( ) <EOL> def validate ( self ) : <EOL> if not self . host : <EOL> return <EOL> if not self . url_validate ( ) : <EOL> raise RuntimeError ( "<STR_LIT>" + <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" ) <EOL> if "<STR_LIT>" not in self . host : <EOL> self . host = self . host + "<STR_LIT>" <EOL> def url_validate ( self ) : <EOL> regex = re . compile ( r'<STR_LIT>' <EOL> r'<STR_LIT>' <EOL> r'<STR_LIT>' <EOL> r'<STR_LIT>' <EOL> r'<STR_LIT>' <EOL> r'<STR_LIT>' , re . IGNORECASE ) <EOL> return regex . match ( self . host ) </s>
