
    Ngg                        d dl Z d dlZd dlmZ dZd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zej                            dg d          d             Zej                            dg d          d             Zej                            dddgfddgfddgfdddgfdg fdg fdddgfddgfddgfd dgfg
          d!             ZdS )"    N)extractzfrom ABC.DEF.local ([ba23::58b5:2236:45g2:88h2]) by
    
 ABC.DEF.local ([ba23::58b5:2236:45g2:88h2%25]) with mapi id    n 32.88.5467.123; Fri, 26 Mar 2021 11:04:09 +1200c                      t          j        t                    5  t          j        ddd           d d d            d S # 1 swxY w Y   d S )NBLAH BLAH BLAHBLAHpytestraises
ValueErrorr   _get_indexed_match     c/var/www/html/ai-engine/env/lib/python3.11/site-packages/test_unstructured/cleaners/test_extract.py,test_get_indexed_match_raises_with_bad_indexr      s    	z	"	" A A"#3VR@@@A A A A A A A A A A A A A A A A A A   >AAc                      t          j        t                    5  t          j        ddd           d d d            d S # 1 swxY w Y   d S )Nr   r      r   r   r   r   1test_get_indexed_match_raises_with_index_too_highr      s    	z	"	" @ @"#3VQ???@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @r   c                  B    d} t          j        | dd          dk    sJ d S )N1Teacher: BLAH BLAH BLAH; Student: BLAH BLAH BLAH!r      zTeacher: BLAH)r   extract_text_beforetexts    r   test_extract_text_beforer      s-    >D&tVQ77?JJJJJJr   c                  B    d} t          j        | dd          dk    sJ d S )Nr   zBLAH;r   zStudent: BLAH BLAH BLAH!)r   extract_text_afterr   s    r   test_extract_text_afterr      s.    >D%dGQ77;UUUUUUUr   c                  @    d} t          j        |           dgk    sJ d S )NzIm Rabn <Im.Rabn@npf.gov.nr>zim.rabn@npf.gov.nr)r   extract_email_addressr   s    r   test_extract_email_addressr!       s-    )D(..3G2HHHHHHHr   c                  H    t          j        t                    ddgk    sJ d S )Nzba23::58b5:2236:45g2:88h2zba23::58b5:2236:45g2:88h2%25)r   extract_ip_addressEMAIL_META_DATA_INPUTr   r   r   test_extract_ip_addressr%   %   s;    %&;<<#&A      r   c                  H    t          j        t                    ddgk    sJ d S )NzABC.DEF.local)r   extract_ip_address_namer$   r   r   r   test_extract_ip_address_namer(   ,   s;    *+@AAF      r   c                  F    t          j        t                    dgk    sJ d S )Nz32.88.5467.123)r   extract_mapi_idr$   r   r   r   test_extract_mapi_idr+   3   s)    "#899>N=OOOOOOOr   c                      t          j        t                    t          j        ddddddt          j        t          j        d                    	          k    sJ d S )
Ni           r   	   i  )seconds)tzinfo)r   extract_datetimetzr$   datetimetimezone	timedeltar   r   r   test_extract_datetimetzr7   7   st    %&;<<@Q	

		 !3E!B!B!BCCA A A      r   c                  2    t          j        d          J d S )NzNO DATE HERE)r   r3   r   r   r   *test_extract_datetimetz_works_with_no_dater9   C   s    %n55=====r   r   expected))215-867-5309r<   )zPhone Number: +1 215.867.5309z+1 215.867.5309)zPhone Number: Just Kidding c                 >    t          j        |           }||k    sJ d S )N)r   extract_us_phone_number)r   r;   phone_numbers      r   test_extract_us_phone_numberrA   G   s+     2488L8######r   ))z1. Introduction:)1NN)za. Introduction:)aNN)u   20.3 Morse code ●●●)203N)z5.3.1 Convolutional Networks )5rE   rB   )zD.b.C Recurrent Neural Networks)DbC)z2.b.1 Recurrent Neural Networks)2rH   rB   )zeins. Neural NetworksNNN)z!bb.c Feed Forward Neural Networks)bbcN)zaaa.ccc MetricsrK   )z version = 3.8rK   )z1 2. 3 4rK   )z	1) 2. 3 4rK   )u   2,3. Morse code 3. ●●●rK   )z1..2.3 fourrK   )zFig. 2: The relationshiprK   )z23 is everywhererK   c                 <    t          j        |           |k    sJ d S Nr   )r   extract_ordered_bulletsr:   s     r   test_extract_ordered_bulletsrQ   T   s)    , *555AAAAAAr   zhttps://my-image.jpgz#https://my-image.png with some textzhttps://my-image.pngz#https://my-image/with/some/path.pngz?some text https://my-image.jpg with another http://my-image.bmpzhttp://my-image.bmpzhttp://not-an-image.comz	some textz?some text https://my-image.JPG with another http://my-image.BMPzhttps://my-image.JPGzhttp://my-image.BMPz%http://my-path-with-CAPS/my-image.JPGzhttp://my-path/my%20image.JPGzhttps://my-image.jpg#refc                 <    t          j        |           |k    sJ d S rO   )r   extract_image_urls_from_htmlr:   s     r   !test_extract_image_urls_from_htmlrT   m   s*    ^ /T:::hFFFFFFr   )r4   r	   unstructured.cleanersr   r$   r   r   r   r   r!   r%   r(   r+   r7   r9   markparametrizerA   rQ   rT   r   r   r   <module>rX      sM     ) ) ) ) ) )9 
A A A
@ @ @
K K K
V V V
I I I
    P P P	 	 	> > >    $ $ $
    *B B+ *B  #$%	

 2$%	

 234	

 N$&;<	

 &	

 	

 N$&;<	

 456	

 ,-.	
 '$%	
M*- -\G G]- -\G G Gr   