def connect(self, creds):
def _conn_help(*args, **kwargs):<EOL><INDENT>return _connect_secureish(<EOL>*args,<EOL>provider=creds,<EOL>calling_format=self.calling_format(),<EOL>auth_region_name=self.region,<EOL>**kwargs)<EOL><DEDENT>impl = os.getenv('<STR_LIT>')<EOL>if impl:<EOL><INDENT>return connection.S3Connection(**_s3connection_opts_from_uri(impl))<EOL><DEDENT>if self.calling_format is connection.SubdomainCallingFormat:<EOL><INDENT>return _conn_help(host='<STR_LIT>')<EOL><DEDENT>assert self.calling_format is connection.OrdinaryCallingFormat<EOL>assert self.ordinary_endpoint is not None<EOL>return _conn_help(host=self.ordinary_endpoint)<EOL>
Return a boto S3Connection set up with great care.

        This includes TLS settings, calling format selection, and
        region detection.

        The credentials are applied by the caller because in many
        cases (instance-profile IAM) it is possible for those
        credentials to fluctuate rapidly.  By comparison, region
        fluctuations of a bucket name are not nearly so likely versus
        the gains of not looking up a bucket's region over and over.