'Login using password authentication and return the client.'

def login_by_password(self):

    from matrix_client.client import MatrixClient
    _client = MatrixClient(base_url=self.homeserver, valid_cert_check=self.verify_tls)
    _client.login_with_password(self.username, self.password)
    self.store_auth_token(_client.token)
    return _client
