<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log_in(self):
 """Perform the `log_in` task to setup the API session for future data requests."""

        if not self.password:
            # Password wasn't give, ask for it now
            self.password = getpass.getpass('Password: ')

        utils.pending_message('Performing login...')

        login_result = self.client.login(
            account=self.account,
            password=self.password
        )

        if 'error' in login_result:
            self.handle_failed_login(login_result)

        utils.info_message('Login successful')