Your IP : 18.188.245.152


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/geoip2/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/geoip2/__pycache__/models.cpython-311.pyc

�

S�DggB��n�dZddlZddlmZddlmZmZmZmZm	Z	m
Z
ddlZddl
mZGd�de��ZGd�d	e��ZGd
�de��ZGd�d
e��ZGd�dee���ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZdS)a&
Models
======

These classes provide models for the data returned by the GeoIP2
web service and databases.

The only difference between the City and Insights model classes is which
fields in each record may be populated. See
http://dev.maxmind.com/geoip/geoip2/web-services for more details.

�N)�ABCMeta)�Any�cast�Dict�List�Optional�Union)�SimpleEqualityc��eZdZUdZejjed<ejjed<ejj	ed<ejjed<ejj
ed<ejjed<	dd	ee
efd
eee
ddfd�Zde
fd
�ZdS)�CountryaCModel for the GeoIP2 Precision: Country and the GeoIP2 Country database.

    This class provides the following attributes:

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    �	continent�country�maxmind�registered_country�represented_country�traitsN�raw_response�locales�returnc�h�|�dg}||_tjj|fi|�di����|_tjj|fi|�di����|_tjj|fi|�di����|_tjj	|fi|�di����|_
tjjdi|�di����|_tjj
di|�di����|_||_dS)	N�enr
rrrrr�)�_locales�geoip2�records�	Continent�getr
rrr�RepresentedCountryr�MaxMindr�Traitsr�raw)�selfrrs   �m/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/geoip2/models.py�__init__zCountry.__init__MsZ���?��f�G���
���1��
�
�#�'�'��R�8�8�
�
����~�-��
�
�#�'�'�	�2�6�6�
�
���#)�.�"8��#
�#
�#�'�'�(<�b�A�A�#
�#
���$*�>�#D��$
�$
�#�'�'�(=�r�B�B�$
�$
�� ��~�-�P�P��0@�0@��B�0O�0O�P�P����n�+�M�M�l�.>�.>�x��.L�.L�M�M��������c�P�|j�d|jj�d|j�d|j�d�S)N�.�(z, �))�
__module__�	__class__�__name__r!r�r"s r#�__repr__zCountry.__repr__es6����W�W���!8�W�W�4�8�W�W�t�}�W�W�W�	
r%�N)r,r*�__qualname__�__doc__rrr�__annotations__rrrr r�strrrrr$r.rr%r#rrs��������-�-�^�~�'�'�'�'�
�^�
#�#�#�#�
�^�
#�#�#�#���.�.�.�.���:�:�:�:��N�!�!�!�!�LP� � � ��c��N� �5=�d�3�i�5H� �	
� � � � �0
�#�
�
�
�
�
�
r%rc����eZdZUdZejjed<ejjed<ejj	ed<ejj
ed<	ddeee
fdeeed	df�fd
�
Z�xZS)�Citya_Model for the GeoIP2 Precision: City and the GeoIP2 City database.

    .. attribute:: city

      City object for the requested IP address.

      :type: :py:class:`geoip2.records.City`

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: location

      Location object for the requested IP address.

      :type: :py:class:`geoip2.records.Location`

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: postal

      Postal object for the requested IP address.

      :type: :py:class:`geoip2.records.Postal`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: subdivisions

      Object (tuple) representing the subdivisions of the country to which
      the location of the requested IP address belongs.

      :type: :py:class:`geoip2.records.Subdivisions`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    �city�location�postal�subdivisionsNrrrc����t���||��tjj|fi|�di����|_tjjdi|�di����|_tjj	di|�di����|_
tjj|g|�dg���R�|_dS)Nr6r7r8r9r)
�superr$rrr5rr6�Locationr7�Postalr8�Subdivisionsr9)r"rrr+s   �r#r$z
City.__init__�s����	������w�/�/�/��N�'��P�P�<�3C�3C�F�B�3O�3O�P�P��	���/�S�S�,�2B�2B�:�r�2R�2R�S�S��
��n�+�M�M�l�.>�.>�x��.L�.L�M�M���"�N�7��
�"�&�&�~�r�:�:�
�
�
����r%r/)r,r*r0r1rrr5r2r<r=r>rr3rrrr$�
__classcell__�r+s@r#r5r5ks���������D�D�L�.�
�����n�%�%�%�%��N�!�!�!�!��.�-�-�-�-�LP�	
�	
� ��c��N�	
�5=�d�3�i�5H�	
�	
�	
�	
�	
�	
�	
�	
�	
�	
�	
�	
r%r5c��eZdZdZdS)�Insightsa�Model for the GeoIP2 Precision: Insights web service endpoint.

    .. attribute:: city

      City object for the requested IP address.

      :type: :py:class:`geoip2.records.City`

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: location

      Location object for the requested IP address.

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: subdivisions

      Object (tuple) representing the subdivisions of the country to which
      the location of the requested IP address belongs.

      :type: :py:class:`geoip2.records.Subdivisions`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    N�r,r*r0r1rr%r#rBrB��������<�<�<�<r%rBc��eZdZdZdS)�
Enterprisea�Model for the GeoIP2 Enterprise database.

    .. attribute:: city

      City object for the requested IP address.

      :type: :py:class:`geoip2.records.City`

    .. attribute:: continent

      Continent object for the requested IP address.

      :type: :py:class:`geoip2.records.Continent`

    .. attribute:: country

      Country object for the requested IP address. This record represents the
      country where MaxMind believes the IP is located.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: location

      Location object for the requested IP address.

    .. attribute:: maxmind

      Information related to your MaxMind account.

      :type: :py:class:`geoip2.records.MaxMind`

    .. attribute:: registered_country

      The registered country object for the requested IP address. This record
      represents the country where the ISP has registered a given IP block in
      and may differ from the user's country.

      :type: :py:class:`geoip2.records.Country`

    .. attribute:: represented_country

      Object for the country represented by the users of the IP address
      when that country is different than the country in ``country``. For
      instance, the country represented by an overseas military base.

      :type: :py:class:`geoip2.records.RepresentedCountry`

    .. attribute:: subdivisions

      Object (tuple) representing the subdivisions of the country to which
      the location of the requested IP address belongs.

      :type: :py:class:`geoip2.records.Subdivisions`

    .. attribute:: traits

      Object with the traits of the requested IP address.

      :type: :py:class:`geoip2.records.Traits`

    NrCrr%r#rFrFrDr%rFc���eZdZUdZeeeeeeffe	d<ee	d<deeeeeeffddfd�Z
defd�Zede
eejejffd���ZdS)	�SimpleModelz.Provides basic methods for non-location modelsr!�
ip_addressrNc��||_d|_|�d��|_t	t
|�d����|_dS)N�
prefix_lenrI)r!�_networkr�_prefix_lenrr3rI)r"r!s  r#r$zSimpleModel.__init__IsE�������
��7�7�<�0�0����s�C�G�G�L�$9�$9�:�:����r%c�@�|j�d|jj�d|j�d�S)Nr'r(r))r*r+r,r!r-s r#r.zSimpleModel.__repr__Os*���/�I�I�D�N�$;�I�I�d�h�I�I�I�Ir%c���|j}t|tjtjf��r|S|j}|j}|�|�dStj|�d|��d��}||_|S)zThe network for the recordN�/F)rL�
isinstance�	ipaddress�IPv4Network�IPv6NetworkrIrM�
ip_network)r"�networkrIrKs    r#rVzSimpleModel.networkRsx��
�-���g�	� 5�y�7L�M�N�N�	��N��_�
��%�
����!3��4��&�*�'C�'C�z�'C�'C�U�K�K����
��r%)r,r*r0r1rr3r	�bool�intr2r$r.�propertyrrRrSrTrVrr%r#rHrHCs��������8�8�	
�c�5��s�C��(�(�	)�)�)�)��O�O�O�;�D��e�D�#�s�N�&;�!;�<�;��;�;�;�;�J�#�J�J�J�J����%�	�(=�y�?T�(T�"U�V�����X���r%rH)�	metaclassc�z��eZdZUdZeed<eed<eed<eed<eed<eed<deeefd	d
f�fd�Z�xZ	S)�AnonymousIPa�Model class for the GeoIP2 Anonymous IP.

    This class provides the following attribute:

    .. attribute:: is_anonymous

      This is true if the IP address belongs to any sort of anonymous network.

      :type: bool

    .. attribute:: is_anonymous_vpn

      This is true if the IP address is registered to an anonymous VPN
      provider.

      If a VPN provider does not register subnets under names associated with
      them, we will likely only flag their IP ranges using the
      ``is_hosting_provider`` attribute.

      :type: bool

    .. attribute:: is_hosting_provider

      This is true if the IP address belongs to a hosting or VPN provider
      (see description of ``is_anonymous_vpn`` attribute).

      :type: bool

    .. attribute:: is_public_proxy

      This is true if the IP address belongs to a public proxy.

      :type: bool

    .. attribute:: is_residential_proxy

      This is true if the IP address is on a suspected anonymizing network
      and belongs to a residential ISP.

      :type: bool

    .. attribute:: is_tor_exit_node

      This is true if the IP address is a Tor exit node.

      :type: bool

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode

    .. attribute:: network

      The network associated with the record. In particular, this is the
      largest network where all of the fields besides ip_address have the same
      value.

      :type: ipaddress.IPv4Network or ipaddress.IPv6Network
    �is_anonymous�is_anonymous_vpn�is_hosting_provider�is_public_proxy�is_residential_proxy�is_tor_exit_noder!rNc���t���|��|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_dS)Nr]Fr^r_r`rarb)	r;r$rr]r^r_r`rarb�r"r!r+s  �r#r$zAnonymousIP.__init__�s����
����������G�G�N�E�:�:��� #���(:�E� B� B���#&�7�7�+@�%�#H�#H�� �"�w�w�'8�%�@�@���$'�G�G�,B�E�$J�$J��!� #���(:�E� B� B����r%)
r,r*r0r1rWr2rr3r$r?r@s@r#r\r\ds���������<�<�|������������������������C�D��d��O�C��C�C�C�C�C�C�C�C�C�Cr%r\c�z��eZdZUdZeeed<eeed<deee	eeffddf�fd�Z
�xZS)�ASNa�Model class for the GeoLite2 ASN.

    This class provides the following attribute:

    .. attribute:: autonomous_system_number

      The autonomous system number associated with the IP address.

      :type: int

    .. attribute:: autonomous_system_organization

      The organization associated with the registered autonomous system number
      for the IP address.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode

    .. attribute:: network

      The network associated with the record. In particular, this is the
      largest network where all of the fields besides ip_address have the same
      value.

      :type: ipaddress.IPv4Network or ipaddress.IPv6Network
    �autonomous_system_number�autonomous_system_organizationr!rNc�*��t���|��ttt|�d����|_ttt|�d����|_dS)Nrgrh)	r;r$rrrXrrgr3rhrds  �r#r$zASN.__init__�ss���
���������(,��S�M�3�7�7�#=�>�>�)
�)
��%�/3��S�M�3�7�7�#C�D�D�/
�/
��+�+�+r%)r,r*r0r1rrXr2r3rr	r$r?r@s@r#rfrf�s�����������@'�s�m�+�+�+�$,�S�M�1�1�1�
�D��e�C��H�o�!5�6�
�4�
�
�
�
�
�
�
�
�
�
r%rfc�d��eZdZUdZeeed<deeeee	ffddf�fd�Z
�xZS)�ConnectionTypea�Model class for the GeoIP2 Connection-Type.

    This class provides the following attribute:

    .. attribute:: connection_type

      The connection type may take the following values:

      - Dialup
      - Cable/DSL
      - Corporate
      - Cellular

      Additional values may be added in the future.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode

    .. attribute:: network

      The network associated with the record. In particular, this is the
      largest network where all of the fields besides ip_address have the same
      value.

      :type: ipaddress.IPv4Network or ipaddress.IPv6Network
    �connection_typer!rNc���t���|��ttt|�d����|_dS)Nrl)r;r$rrr3rrlrds  �r#r$zConnectionType.__init__sD���
���������#�H�S�M�3�7�7�;L�3M�3M�N�N����r%�r,r*r0r1rr3r2rr	rXr$r?r@s@r#rkrk�s�����������@�c�]�"�"�"�O�D��e�C��H�o�!5�6�O�4�O�O�O�O�O�O�O�O�O�Or%rkc�d��eZdZUdZeeed<deeeee	ffddf�fd�Z
�xZS)�DomainaModel class for the GeoIP2 Domain.

    This class provides the following attribute:

    .. attribute:: domain

      The domain associated with the IP address.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode

    .. attribute:: network

      The network associated with the record. In particular, this is the
      largest network where all of the fields besides ip_address have the same
      value.

      :type: ipaddress.IPv4Network or ipaddress.IPv6Network

    �domainr!rNc���t���|��ttt|�d����|_dS)Nrq)r;r$rrr3rrqrds  �r#r$zDomain.__init__(s@���
����������8�C�=�#�'�'�(�*;�*;�<�<����r%rnr@s@r#rprps{����������4
�S�M����=�D��e�C��H�o�!5�6�=�4�=�=�=�=�=�=�=�=�=�=r%rpc�z��eZdZUdZeeed<eeed<deeeee	ffddf�fd�Z
�xZS)�ISPa�Model class for the GeoIP2 ISP.

    This class provides the following attribute:

    .. attribute:: autonomous_system_number

      The autonomous system number associated with the IP address.

      :type: int

    .. attribute:: autonomous_system_organization

      The organization associated with the registered autonomous system number
      for the IP address.

      :type: unicode

    .. attribute:: isp

      The name of the ISP associated with the IP address.

      :type: unicode

    .. attribute:: organization

      The name of the organization associated with the IP address.

      :type: unicode

    .. attribute:: ip_address

      The IP address used in the lookup.

      :type: unicode

    .. attribute:: network

      The network associated with the record. In particular, this is the
      largest network where all of the fields besides ip_address have the same
      value.

      :type: ipaddress.IPv4Network or ipaddress.IPv6Network
    �isp�organizationr!rNc�*��t���|��ttt|�d����|_ttt|�d����|_dS)Nrurv)r;r$rrr3rrurvrds  �r#r$zISP.__init__^sb���
������������
�s�w�w�u�~�~�6�6��� ��#������0G�0G�H�H����r%rnr@s@r#rtrt-s���������*�*�X
�#������3�-����I�D��e�C��H�o�!5�6�I�4�I�I�I�I�I�I�I�I�I�Ir%rt)r1rR�abcr�typingrrrrrr	�geoip2.recordsr�
geoip2.mixinsr
rr5rBrFrHr\rfrkrprtrr%r#�<module>r|sm��������������9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�����(�(�(�(�(�(�R
�R
�R
�R
�R
�n�R
�R
�R
�jU
�U
�U
�U
�U
�7�U
�U
�U
�p=�=�=�=�=�t�=�=�=�@=�=�=�=�=��=�=�=�@�����.�G�����BMC�MC�MC�MC�MC�+�MC�MC�MC�`,
�,
�,
�,
�,
�+�,
�,
�,
�^%O�%O�%O�%O�%O�[�%O�%O�%O�P=�=�=�=�=�[�=�=�=�D4I�4I�4I�4I�4I�#�4I�4I�4I�4I�4Ir%

?>