<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def login(self, username=None, password=None):
 """Login to a vSphere server. :param username: The username to authenticate as. :type username: str :param password: The password to authenticate with. :type password: str """

        if username is None:
            username = self.username
        if password is None:
            password = self.password
        logger.debug("Logging into server")
        self.sc.sessionManager.Login(userName=username, password=password)
        self._logged_in = True