<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_use(self, region):
 """ Switch the AWS region > use us-west-1 > use us-east-1 """

        if self._local_endpoint is not None:
            host, port = self._local_endpoint  # pylint: disable=W0633
            self.engine.connect(
                region, session=self.session, host=host, port=port, is_secure=False
            )
        else:
            self.engine.connect(region, session=self.session)