def _analyze_endpoint(self, ip):
        """Returns information about endpoint (IP address)

        :param ip: String representation of IP address.
        :param port: Port number.
        :returns: Dictionary with endpoint information.
        """
        if self._maxmind:
            # get maxmind geolite2 info
            try:
                rc = self._reader_city.city(ip)
                ra = self._reader_asn.asn(ip)
                endpoint = {
                    'ip': ip,
                    'ports': [],
                    'country': rc.country.name,
                    'city': rc.city.name,
                    'asn': ra.autonomous_system_number,
                    'organization': ra.autonomous_system_organization,
                    'blacklisted': is_ip_blacklisted(ip),
                    'data_in': 0,
                    'data_out': 0
                }
            except geoip2.errors.AddressNotFoundError as e:
                endpoint = {
                    'ip': ip,
                    'ports': [],
                    'blacklisted': is_ip_blacklisted(ip),
                    'data_in': 0,
                    'data_out': 0
                }
        else:
            endpoint = {
                'ip': ip,
                'ports': [],
                'blacklisted': is_ip_blacklisted(ip),
                'data_in': 0,
                'data_out': 0
            }

        # report anomaly
        if endpoint['blacklisted']:
            name = 'blacklisted_ip_access'
            description = ('Sample contacted endpoint with IP '
                           'address present on blacklist.')
            data = {
                'ip_address': ip
            }

            anomaly = Anomaly(name, description, data)
            self._anomalies.append(anomaly.to_dict())

        return endpoint
Returns information about endpoint (IP address)

        :param ip: String representation of IP address.
        :param port: Port number.
        :returns: Dictionary with endpoint information.
        
lisa/analysis/network_analysis.py