o
    NDi                     @   s   d dl Z d dlmZ d dlmZ g dZG dd deZG dd deZG d	d
 d
eZ	G dd deZ
G dd deZG dd deZdS )    NP)Distance)GeoPTextDistancePSearchGeoUnitGeoCqlCollectionc                   @   s2   e Zd Zd
ddZedd Zdd Zdd	 ZdS )r   Nc                 C      || _ || _|| _d S N)operatorvalueother)selfr   r   r    r   d/var/www/Datamplify/venv/lib/python3.10/site-packages/cassandra/datastax/graph/fluent/_predicates.py__init__      
zGeoP.__init__c                  O   s   t dg| R i |S )Ninside)r   )argskwargsr   r   r   r      s   zGeoP.insidec                 C   0   t || jo| j|jko| j|jko| j|jkS r   )
isinstance	__class__r   r   r   r   r   r   r   r   __eq__#      


zGeoP.__eq__c                 C   sH   | j d u r| jd t| j d S | jd t| j d t| j  d S )N(),)r   r   strr   r   r   r   r   __repr__'   s   ,zGeoP.__repr__r   )__name__
__module____qualname__r   staticmethodr   r   r#   r   r   r   r   r      s    

r   c                   @   sH   e Zd Zdd Zedd Zedd Zedd Zd	d
 Zdd Z	dS )r   c                 C   r   r   )r   r   distance)r   r   r   r(   r   r   r   r   .   r   zTextDistanceP.__init__c                  G      t dg| R  S )Nfuzzyr   r   r   r   r   r*   3      zTextDistanceP.fuzzyc                  G   r)   )N
tokenFuzzyr+   r,   r   r   r   token_fuzzy7   r-   zTextDistanceP.token_fuzzyc                  G   r)   )Nphraser+   r,   r   r   r   r0   ;   r-   zTextDistanceP.phrasec                 C   r   r   )r   r   r   r   r(   r   r   r   r   r   ?   r   zTextDistanceP.__eq__c                 C   s&   | j d t| j d t| j d S )Nr   r    r   )r   r!   r   r(   r"   r   r   r   r#   C   s   &zTextDistanceP.__repr__N)
r$   r%   r&   r   r'   r*   r/   r0   r   r#   r   r   r   r   r   ,   s    


r   c                   @   sl   e Zd Zedd Zedd Zedd Zedd Zed	d
 Zedd Z	edd Z
edd ZdS )r   c                 C   
   t d| S )z
        Search any instance of a certain token within the text property targeted.
        :param value: the value to look for.
        tokenr   r   r   r   r   r2   I      
zSearch.tokenc                 C   r1   )z
        Search any instance of a certain token prefix withing the text property targeted.
        :param value: the value to look for.
        tokenPrefixr   r3   r   r   r   token_prefixQ   r4   zSearch.token_prefixc                 C   r1   )z
        Search any instance of the provided regular expression for the targeted property.
        :param value: the value to look for.
        
tokenRegexr   r3   r   r   r   token_regexY   r4   zSearch.token_regexc                 C   r1   )z
        Search for a specific prefix at the beginning of the text property targeted.
        :param value: the value to look for.
        prefixr   r3   r   r   r   r9   a   r4   zSearch.prefixc                 C   r1   )z
        Search for this regular expression inside the text property targeted.
        :param value: the value to look for.
        regexr   r3   r   r   r   r:   i   r4   zSearch.regexc                 C      t | |S )z
        Search for a fuzzy string inside the text property targeted.
        :param value: the value to look for.
        :param distance: The distance for the fuzzy search. ie. 1, to allow a one-letter misspellings.
        )r   r*   r   r(   r   r   r   r*   q      zSearch.fuzzyc                 C   r;   )z
        Search for a token fuzzy inside the text property targeted.
        :param value: the value to look for.
        :param distance: The distance for the token fuzzy search. ie. 1, to allow a one-letter misspellings.
        )r   r/   r<   r   r   r   r/   z   r=   zSearch.token_fuzzyc                 C   r;   )a  
        Search for a phrase inside the text property targeted.
        :param value: the value to look for.
        :param proximity: The proximity for the phrase search. ie. phrase('David Felcey', 2).. to find 'David Felcey' with up to two middle names.
        )r   r0   )r   	proximityr   r   r   r0      r=   zSearch.phraseN)r$   r%   r&   r'   r2   r6   r8   r9   r:   r*   r/   r0   r   r   r   r   r   G   s"    






r   c                   @   s<   e Zd Zedd Zedd Zedd Zedd Zd	S )
r
   c                 C   r1   )zo
        Search for a value inside a cql list/set column.
        :param value: the value to look for.
        containsr   r3   r   r   r   r?      r4   zCqlCollection.containsc                 C   r1   )zV
        Search for a map value.
        :param value: the value to look for.
        containsValuer   r3   r   r   r   contains_value   r4   zCqlCollection.contains_valuec                 C   r1   )zT
        Search for a map key.
        :param value: the value to look for.
        containsKeyr   r3   r   r   r   contains_key   r4   zCqlCollection.contains_keyc                 C   r1   )zV
        Search for a map entry.
        :param value: the value to look for.
        entryEqr   r3   r   r   r   entry_eq   r4   zCqlCollection.entry_eqN)r$   r%   r&   r'   r?   rA   rC   rE   r   r   r   r   r
      s    


r
   c                   @   sF   e Zd ZdZejd Zee Zde ZdZ	e	e Z
eZed ZdZdS )r   g$>@      g~߿?g     @@N)r$   r%   r&   _EARTH_MEAN_RADIUS_KMmathpi_DEGREES_TO_RADIANS
_DEG_TO_KM
_KM_TO_DEG_MILES_TO_KMMILES
KILOMETERSMETERSDEGREESr   r   r   r   r      s    
r   c                   @   s   e Zd ZeejfddZdS )r	   c                 C   s    t jt| j| j| j| ddS )a,  
        Search any instance of geometry inside the Distance targeted.
        :param value: A Distance to look for.
        :param units: The units for ``value``. See GeoUnit enum. (Can also
            provide an integer to use as a multiplier to convert ``value`` to
            degrees.)
        )xyradiusr3   )r   r   r   rS   rT   rU   )r   unitsr   r   r   r      s   	z
Geo.insideN)r$   r%   r&   r'   r   rR   r   r   r   r   r   r	      s    r	   )rI    gremlin_python.process.traversalr   cassandra.utilr   __all__objectr   r   r   r
   r   r	   r   r   r   r   <module>   s   F#