def __init__(self, username=None, api_key=None, container=None,<EOL>connection_kwargs=None, container_uri=None):
if username is not None:<EOL><INDENT>self.username = username<EOL><DEDENT>if api_key is not None:<EOL><INDENT>self.api_key = api_key<EOL><DEDENT>if container is not None:<EOL><INDENT>self.container_name = container<EOL><DEDENT>if connection_kwargs is not None:<EOL><INDENT>self.connection_kwargs = connection_kwargs<EOL><DEDENT>if self.use_pyrax:<EOL><INDENT>self.pyrax = pyrax<EOL>if self.pyrax_identity_type:<EOL><INDENT>self.pyrax.set_setting("<STR_LIT>", self.pyrax_identity_type)<EOL><DEDENT>if self.auth_url:<EOL><INDENT>self.pyrax.set_setting("<STR_LIT>", self.auth_url)<EOL><DEDENT>if self.auth_tenant_id:<EOL><INDENT>self.pyrax.set_setting("<STR_LIT>", self.auth_tenant_id)<EOL><DEDENT>self.pyrax.set_setting("<STR_LIT>", self.region)<EOL>try:<EOL><INDENT>self.pyrax.set_credentials(self.username, self.api_key)<EOL><DEDENT>except (Error, PyraxException, RequestException) as e:<EOL><INDENT>logging.warning('<STR_LIT>', e.__class__.__name__, str(e))<EOL><DEDENT>except Exception as e:<EOL><INDENT>logging.exception(<EOL>"""<STR_LIT>""")<EOL><DEDENT><DEDENT>
Initializes the settings for the connection and container.