def __init__(self, url, version='<STR_LIT>', xml=None, username=None, password=None, parse_remote_metadata=False, timeout=<NUM_LIT:30>):
self.url = url<EOL>self.username = username<EOL>self.password = password<EOL>self.version = version<EOL>self.timeout = timeout<EOL>self.services = None<EOL>self._capabilities = None<EOL>self.contents={}<EOL>reader = TMSCapabilitiesReader(<EOL>self.version, url=self.url, un=self.username, pw=self.password<EOL>)<EOL>if xml:  <EOL><INDENT>self._capabilities = reader.readString(xml)<EOL><DEDENT>else:  <EOL><INDENT>self._capabilities = reader.read(self.url, timeout=self.timeout)<EOL><DEDENT>self._buildMetadata(parse_remote_metadata)<EOL>
Initialize.