<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_whitelisted(self, addrinfo):
 """ Returns if a result of ``socket.getaddrinfo`` is in the socket address whitelist. """

        # For details about the ``getaddrinfo`` struct, see the Python docs:
        # http://docs.python.org/library/socket.html#socket.getaddrinfo
        family, socktype, proto, canonname, sockaddr = addrinfo
        address, port = sockaddr[:2]
        return address in self.socket_address_whitelist