<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handler(self):
 """gets the security handler for the class"""

        if hasNTLM:
            if self._handler is None:
                passman = request.HTTPPasswordMgrWithDefaultRealm()
                passman.add_password(None, self._parsed_org_url, self._login_username, self._password)
                self._handler = HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(passman)
            return self._handler
        else:
            raise Exception("Missing Ntlm python package.")