
     j                        d dl mZmZ d dlZd dlZd dlmZmZm	Z	  ej
        d          Zd dlmZ ej        d             Zej        d             Zej        d             Zej        d	             Zej        d
             Zd Zd Zd 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ddg          ej"        #                    dddg          ej"        #                    dddg          d                                     Z$ej"        #                    dddg          ej"        #                    dddg          d                         Z%ej"        #                    dddg          ej"        #                    dddg          ej"        #                    d d!gd"gd"g          d#                                     Z&d$ Z'ej"        #                    d%g d&          d'             Z(ej"        #                    dddg          ej"        #                    dddg          d(                         Z)ej"        #                    d)ddg          ej"        #                    d*ddg          d+                         Z*d, Z+d- Z,d. Z-d/ Z.d0 Z/d1 Z0ej"        #                    d2d3dg          ej"        #                    d4g d5          d6                         Z1d7 Z2d8 Z3d9 Z4d: Z5d; Z6d< Z7dS )=    )dedentindentN)	DataFrame
MultiIndexoption_contextjinja2)Stylerc                  t    t                               dd          } t                               | d          }|S )Npandaszio/formats/templatesT)loadertrim_blocks)r   PackageLoaderEnvironment)r   envs     {C:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\pandas/tests/io/formats/style/test_html.pyr   r      s5    !!(,BCCF


F

=
=CJ    c                  N    t          t          dgdggddgdg                    S )NzG@Q@abAindexcolumns)r	   r    r   r   stylerr      s.    )dVdV,S#JNNNOOOr   c                      t          j        ddgddgg          } t          t          t	          j        d                              dd          | |                     S )Nr   r   cd      r   )r   from_productr	   r   nparangereshape)midxs    r   	styler_mir(      sT    "S#Jc
#;<<D)BIbMM11!Q77tTRRRSSSr   c                 ,    |                      d          S )Nzhtml_style.tplget_templater   s    r   	tpl_styler-   %       ,---r   c                 ,    |                      d          S )Nzhtml_table.tplr*   r,   s    r   	tpl_tabler0   *   r.   r   c                      t          dd          5 } |                                 }d d d            n# 1 swxY w Y   d|v sJ d|v sJ d S )Nz$pandas/io/formats/templates/html.tplzutf-8)encodingz{% include html_style_tpl %}z{% include html_table_tpl %})openread)fileresults     r   "test_html_template_extends_optionsr7   /   s     
4w	G	G	G 4              )V3333)V333333s   377c                 b    |                      dd          }t          d          }||k    sJ d S )NT)exclude_stylesdoctype_htmla          <!DOCTYPE html>
        <html>
        <head>
        <meta charset="utf-8">
        </head>
        <body>
        <table>
          <thead>
            <tr>
              <th >&nbsp;</th>
              <th >A</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th >a</th>
              <td >2.610000</td>
            </tr>
            <tr>
              <th >b</th>
              <td >2.690000</td>
            </tr>
          </tbody>
        </table>
        </body>
        </html>
        )to_htmlr   r   r6   expecteds      r   test_exclude_stylesr>   8   sD    ^^4d^CCF	 H< Xr   c                    |                      d                              dddg                              d                               d                              t          dgdgd	g
                                        d                              d           t          d          }|| 	                                k    sJ d S )N thzatt2:v2;selectorpropsc                     dS )Nzatt1:v1;r   )xs    r   <lambda>z%test_w3_html_format.<locals>.<lambda>]   s    * r   z!class="my-cls1" style="attr3:v3;"zmy-cls2r   r   r   z{:.1f}zA comprehensive testa          <style type="text/css">
        #T_ th {
          att2: v2;
        }
        #T__row0_col0, #T__row1_col0 {
          att1: v1;
        }
        </style>
        <table id="T_" class="my-cls1" style="attr3:v3;">
          <caption>A comprehensive test</caption>
          <thead>
            <tr>
              <th class="blank level0" >&nbsp;</th>
              <th id="T__level0_col0" class="col_heading level0 col0" >A</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th id="T__level0_row0" class="row_heading level0 row0" >a</th>
              <td id="T__row0_col0" class="data row0 col0 my-cls2" >2.6</td>
            </tr>
            <tr>
              <th id="T__level0_row1" class="row_heading level0 row1" >b</th>
              <td id="T__row1_col0" class="data row1 col0" >2.7</td>
            </tr>
          </tbody>
        </table>
        )
set_uuidset_table_stylesmapset_table_attributesset_td_classesr   formatset_captionr   r;   )r   r=   s     r   test_w3_html_formatrO   [   s    
OOB((tj*Q*Q)RSSWW >??9+cUSE:::A Af k   	 H> v~~''''''''r   c                      t          ddggddgddgg          } t          | dd	          }d
|                                v sJ d S )N      l0l1al1b)datar   _Fuuidcell_idsz7<th class="col_heading level0 col0" colspan="2">l0</th>r   r	   r;   dfr   s     r   test_colspan_w3r^      s\    	!QD$<%*H	I	I	IBBS5111FDHXHXXXXXXXr   c                      t          ddggddgddgg          } t          | dd	          }d
|                                v sJ d S )NrQ   rR   rS   rT   rU   )rV   r   rW   FrX   z7<th class="row_heading level0 row0" rowspan="2">l0</th>r[   r\   s     r   test_rowspan_w3r`      s\    	!Q$u~(F	G	G	GBBS5111FDHXHXXXXXXXr   c                     |                      d           |                     dddg           |                     d          }t          d          }||k    sJ d S )Nabctdcolor: red;rB   Tr:   a          <!DOCTYPE html>
        <html>
        <head>
        <meta charset="utf-8">
        <style type="text/css">
        #T_abc td {
          color: red;
        }
        </style>
        </head>
        <body>
        <table id="T_abc">
          <thead>
            <tr>
              <th class="blank level0" >&nbsp;</th>
              <th id="T_abc_level0_col0" class="col_heading level0 col0" >A</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th id="T_abc_level0_row0" class="row_heading level0 row0" >a</th>
              <td id="T_abc_row0_col0" class="data row0 col0" >2.610000</td>
            </tr>
            <tr>
              <th id="T_abc_level0_row1" class="row_heading level0 row1" >b</th>
              <td id="T_abc_row1_col0" class="data row1 col0" >2.690000</td>
            </tr>
          </tbody>
        </table>
        </body>
        </html>
        )rH   rI   r;   r   r<   s      r   test_stylesrf      st    
OOE
$GGHIII^^^..F 	" "HF Xr   c                 b    |                      d          }d|vsJ d|vsJ d|vsJ d|vsJ d S )NFre   z<html>z<body>z<!DOCTYPE html>z<head>r;   r   r6   s     r   test_doctyperj      s_    ^^^//F6!!!!6!!!!F****6!!!!!!r   c                     t          dd          5  |                     d          }d|v sJ |                     dd          }d|v sJ 	 d d d            d S # 1 swxY w Y   d S )	Nzstyler.render.encodingASCIITre   z<meta charset="ASCII">ANSI)r:   r2   z<meta charset="ANSI">)r   r;   ri   s     r   test_doctype_encodingrn      s    	0'	:	: 1 1T22'61111TFCC&&00000	1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1s   :AA Ac                 r    |                      d          }d|v sJ |                                  }d|vsJ d S )NT)bold_headerszth {
  font-weight: bold;
}rh   ri   s     r   test_bold_headers_argrq      sL    ^^^..F*f4444^^F*&888888r   c                 r    |                      d          }d|v sJ |                                  }d|vsJ d S )Nzfoo bar)captionz<caption>foo bar</caption>rh   ri   s     r   test_caption_argrt      sL    ^^I^..F'61111^^F'v555555r   c                     h d}h d}t          | j                  }||k    sJ t          |j                  }||k    sJ d S )N>   style	cellstylebefore_styletable_stylesbefore_cellstyle>   trtabletbodytheadrs   head_tr
after_rowsafter_tablebefore_rowsbefore_tableafter_head_rowsbefore_head_rows)setblocks)r-   r0   expected_styleexpected_tableresult1result2s         r   test_block_namesr      sn      N  N )"##Gn$$$$)"##Gn$$$$$$r   c                    |                      d                              d          }|                    t          d                     t	          j        t          |                     d                    d          }t          |t                    sJ |j        t          j        usJ |j	        t          j	        usJ  |t          dddgi                    }d|                    d	          v sJ d S )
Ntplzmyhtml_table.tplz            {% extends "html_table.tpl" %}
            {% block table %}
            <h1>{{custom_title}}</h1>
            {{ super() }}
            {% endblock table %}r   rQ   rR   z<h1>My Title</h1>


<tablezMy Title)custom_title)mkdirjoinwriter   r	   from_custom_templatestr
issubclassr   template_html_tabler   r;   tmpdirpr6   r   s       r   test_from_custom_template_tabler      s    U  !344AGG$	
 	
	 	 	 (V[[-?-?)@)@BTUUFff%%%%%:VZ''''%V-GGGGGVIsQFm,,--F*fnn*n.U.UUUUUUUr   c                    |                      d                              d          }|                    t          d                     t	          j        t          |                     d                    d          }t          |t                    sJ |j        t          j        usJ |j	        t          j	        usJ  |t          dddgi                    }d|                                v sJ d S )	Nr   zmyhtml_style.tplz            {% extends "html_style.tpl" %}
            {% block style %}
            <link rel="stylesheet" href="mystyle.css">
            {{ super() }}
            {% endblock style %})
html_styler   rQ   rR   z2<link rel="stylesheet" href="mystyle.css">

<style)r   r   r   r   r	   r   r   r   r   template_html_styler   r;   r   s       r   test_from_custom_template_styler     s   U  !344AGG$	
 	
	 	 	 (FKK,>  F ff%%%%%:VZ''''%V-GGGGGVIsQFm,,--FAV^^EUEUUUUUUUr   c                 `    |                      d           d|                                 v sJ d S )N)zfull capz	short capz<caption>full cap</caption>)rN   r;   r   s    r   test_caption_as_sequencer   %  s8    
0111(FNN,<,<<<<<<<r   r   FTr   
index_namec                 
   |rd| j         _        |r|                     d           |r|                     d           d}d}|                     d                                          }|                    dd	          |v |u sJ |                    d
d          |v |u sJ |                    dddd          |v |o|u sJ |                    dddd          |v |o|u sJ |                    dddd          |v |o| u sJ d S )Nz	some textr   axisrQ   z[#T_ {0} {{
  position: sticky;
  background-color: inherit;
  left: 0px;
  z-index: {1};
}}z_#T_ {0} {{
  position: sticky;
  background-color: inherit;
  top: {1}px;
  z-index: {2};
{3}}}r@   thead tr th:nth-child(1)3 !importantztbody tr th:nth-child(1)1thead tr:nth-child(1) th02z  height: 25px;
thead tr:nth-child(2) th25)r   name
set_stickyrH   r;   rM   )r   r   r   r   left_csstop_cssress          r   test_sticky_basicr   *  s     (' "q!!! "q!!!	, 
	0 
 //"


%
%
'
'C OO6GG3NSXXXXXOO6<<CMMMM 	13=PQQUXX

 j" " " " 	14>QRR	

 j" " " " NN5sCDDK"
N     r   c                    |r|                      d           |r|                      d           d}d}|                     d                                          }|                    ddd	          |v |u sJ |                    d
dd          |v |u sJ |                    ddd	          |v |u sJ |                    ddd          |v |u sJ |                    ddd          |v |u sJ |                    ddd          |v |u sJ d S )Nr   r   rQ   #T_ {0} {{
  position: sticky;
  background-color: inherit;
  left: {1}px;
  min-width: 75px;
  max-width: 75px;
  z-index: {2};
}}l#T_ {0} {{
  position: sticky;
  background-color: inherit;
  top: {1}px;
  height: 25px;
  z-index: {2};
}}r@   r   r   r   ztbody tr th.level0r   thead tr th:nth-child(2)75tbody tr th.level1r   r   r   r   )r   rH   r;   rM   )r(   r   r   r   r   r   s         r   test_sticky_mir   Q  s     %!$$$ %!$$$	V 
	> 
 

R
 
 
(
(
*
*C 	2CHHCO	    OO0#s;;sBuLLLL2D.IISP	    OO0$<<CMMMM NN5sC@@CGGSSSSNN5tSAASHWTTTTTTr   levelsrQ   onec                    ddgddgc| j         _        | j        _        |r|                     d|           |r|                     d|           d}d}|                     d                                          }d	|vsJ d
|vsJ d|vsJ |                    ddd          |v |u sJ |                    ddd          |v |u sJ |                    ddd          |v |u sJ d S )Nzeror   r   )r   r   rQ   r   r   r@   z#T_ thead tr th:nth-child(1)z#T_ tbody tr th.level0z#T_ thead tr:nth-child(1) thr   r   r   r   r   r   r   )r   namesr   r   rH   r;   rM   )r(   r   r   r   r   r   r   s          r   test_sticky_levelsr   s  sX    7=e_vuo2IO9,2 4!F333 4!F333	V 
	> 
 

R
 
 
(
(
*
*C *4444#3....)4444 	2CHHCO	    OO0#s;;sBuLLLLNN5sC@@CGGSSSSSSr   c                     t          j        t          d          5  |                     d           d d d            d S # 1 swxY w Y   d S )Nz+No axis named bad for object type DataFrame)matchbadr   )pytestraises
ValueErrorr   r   s    r   test_sticky_raisesr     s    	z)V	W	W	W & &u%%%& & & & & & & & & & & & & & & & & &s   A  AAzsparse_index, sparse_columns))TT)TF)FT)FFc                    t          j        g d          }t          j        g d          }t          g dg dg dg||          }|j        }|                                }t          d| d|          5  |                                }||k    | o|u sJ 	 d d d            n# 1 swxY w Y   |                    | |	          }||k    sJ d S )
N))Zr   )r   r   )Yr   ))r   r   )r   r   )Br   rQ   rR      )r"         )      	   r   zstyler.sparse.indexzstyler.sparse.columns)sparse_indexsparse_columns)r   from_tuplesr   rv   r;   r   )	r   r   cidxridxr]   r   default_htmlhtml1html2s	            r   test_sparse_optionsr     sK   
 !"F"F"FGGD!"F"F"FGGD	IIIyyy)))4D$	O	O	OBXF>>##L	|-Dn
 
 L L   %<+JNKKKKK	L L L L L L L L L L L L L L L
 NN^NTTEE>s   5!B##B'*B'c                    d }d\  | _         | _        |r|                     |d           |r|                     |d           |                                 }d|v sJ d|v sJ d|v |u sJ d	|v |u sJ d
|v |u sJ d|v |u sJ d|v |u sJ d S )Nc                     dS )Nz
attr: val;r   vs    r   rG   z*test_map_header_cell_ids.<locals>.<lambda>  s    \ r   )r@   Fr   r   r   z)<td class="data row0 col0" >2.610000</td>z)<td class="data row1 col0" >2.690000</td>z?<th id="T__level0_row0" class="row_heading level0 row0" >a</th>z?<th id="T__level0_row1" class="row_heading level0 row1" >b</th>z1#T__level0_row0, #T__level0_row1 {
  attr: val;
}z?<th id="T__level0_col0" class="col_heading level0 col0" >A</th>z #T__level0_col0 {
  attr: val;
})rY   rZ   	map_indexr;   )r   r   r   funcr6   s        r   test_map_header_cell_idsr     s-    "!D#, FK -G,,, /I...^^F 7&@@@@6&@@@@ 	JVS	    	JVS	    BVKPUUUUU 	JVS	    1F:wFFFFFFr   rowscolsc                 p    |                      |rdnd |rdnd           }d|v sJ d|v |usJ d|v |usJ d S )NrR   )max_rowsmax_columnsz>5</td>z>8</td>z>2</td>rh   )r(   r   r   r6   s       r   test_maximumsr     s{     $'AA4   F
 ,,,,,,,,,,r   c                     dddddddd} t          j        d	d
gddgg          }t          t          t	          j        d                              dd          ||          d                              |           }ddg|j        _	        |
                    |j        dd          d           |
                    |j        dd          d           |                    d d           |                    d d           |                    d            t          d          }|                                }||k    sJ d S )NROWHEADIDXNAMEROWROWTRIMLEVELDATABLANK)row_headingr   rowrow_trimlevelrV   blankr   r   r   r    r!   r"   r   r   uuid_len)css_class_namesn1n2rQ   r   c                     dS )Nrd   r   r   s    r   rG   z/test_replaced_css_class_names.<locals>.<lambda>  s    - r   c                     dS )Nzcolor: green;r   r   s    r   rG   z/test_replaced_css_class_names.<locals>.<lambda>  s    / r   c                     dS Nzcolor: blue;r   r   s    r   rG   z/test_replaced_css_class_names.<locals>.<lambda>  s    N r   a8      <style type="text/css">
    #T__ROW0_col0 {
      color: blue;
    }
    #T__LEVEL0_ROW0, #T__LEVEL1_ROW0 {
      color: red;
    }
    #T__LEVEL0_col0, #T__LEVEL1_col0 {
      color: green;
    }
    </style>
    <table id="T_">
      <thead>
        <tr>
          <th class="BLANK" >&nbsp;</th>
          <th class="IDXNAME LEVEL0" >n1</th>
          <th id="T__LEVEL0_col0" class="col_heading LEVEL0 col0" >a</th>
        </tr>
        <tr>
          <th class="BLANK" >&nbsp;</th>
          <th class="IDXNAME LEVEL1" >n2</th>
          <th id="T__LEVEL1_col0" class="col_heading LEVEL1 col0" >c</th>
        </tr>
        <tr>
          <th class="IDXNAME LEVEL0" >n1</th>
          <th class="IDXNAME LEVEL1" >n2</th>
          <th class="BLANK col0" >&nbsp;</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th id="T__LEVEL0_ROW0" class="ROWHEAD LEVEL0 ROW0" >a</th>
          <th id="T__LEVEL1_ROW0" class="ROWHEAD LEVEL1 ROW0" >c</th>
          <td id="T__ROW0_col0" class="DATA ROW0 col0" >0</td>
        </tr>
      </tbody>
    </table>
    )r   r#   r	   r   r$   r%   r&   rI   r   r   hider   r   rJ   r   r;   )cssr'   r(   r=   r6   s        r   test_replaced_css_class_namesr    s{     C "S#Jc
#;<<D")B--''1--T4HHH   s++  "4LIONN9?122&QN///NN9$QRR(qN111//a88811:::MM**+++&	( (HR   FXr   c                 B   |                      d                              d                               | j        j        dd          d                              | j        j        dd          d                                          }t          d          }||v sJ d S )Nr@   c                     dS r   r   r   s    r   rG   zEtest_include_css_style_rules_only_for_visible_cells.<locals>.<lambda>&  s    ~ r   rQ   r   r   r   zr        <style type="text/css">
        #T__row0_col0 {
          color: blue;
        }
        </style>
        )rH   rJ   r   rV   r   r   r;   r   r(   r6   expected_styless      r   3test_include_css_style_rules_only_for_visible_cellsr  "  s     	2	%%	&	&	in$QRR(y	9	9	in"122&W	5	5	  	 O f$$$$$$r   c                 6   |                      d                              d d                              | j        j        d                              | j        j        dd          d                                          }t          d          }||v sJ d S )Nr@   c                     dS r   r   r   s    r   rG   zLtest_include_css_style_rules_only_for_visible_index_labels.<locals>.<lambda>;      ^ r   r   r   r   rQ   z        <style type="text/css">
        #T__level0_row0, #T__level1_row0 {
          color: blue;
        }
        </style>
        rH   r   r   rV   r   r   r;   r   r  s      r   :test_include_css_style_rules_only_for_visible_index_labelsr  7  s     	2	++'	:	:	in$9	5	5	in"122&W	5	5	  	 O f$$$$$$r   c                 6   |                      d                              d d                              | j        j        dd          d                              | j        j        d                                          }t          d          }||v sJ d S )Nr@   c                     dS r   r   r   s    r   rG   zMtest_include_css_style_rules_only_for_visible_column_labels.<locals>.<lambda>P  r	  r   r   r   rQ   r   z        <style type="text/css">
        #T__level0_col0, #T__level1_col0 {
          color: blue;
        }
        </style>
        r
  r  s      r   ;test_include_css_style_rules_only_for_visible_column_labelsr  L  s     	2	++)	<	<	in$QRR(y	9	9	in"	1	1	  	 O f$$$$$$r   c                  &   t          j        ddgdgddggg d          } t          j        dgd	d
gddggg d          }t          t          j        d                              dd          | |          }t          |d          }|                    dd                              dd           |                    dgd           |                    dgd           |                                }t          d          }||k    sJ d S )Ni0j0i1i2j2)zi-0zi-1zi-2)r   c0c1d1c2d2)zc-0zc-1zc-2r!   r"   r   r   r   rQ   )r   r   )r  r  r  r   )r  r  r  a
      <style type="text/css">
    </style>
    <table id="T_">
      <thead>
        <tr>
          <th class="blank" >&nbsp;</th>
          <th class="index_name level1" >c-1</th>
          <th id="T__level1_col0" class="col_heading level1 col0" colspan="2">c1</th>
          <th id="T__level1_col2" class="col_heading level1 col2" >d1</th>
        </tr>
        <tr>
          <th class="blank" >&nbsp;</th>
          <th class="index_name level2" >c-2</th>
          <th id="T__level2_col0" class="col_heading level2 col0" >c2</th>
          <th id="T__level2_col1" class="col_heading level2 col1" >d2</th>
          <th id="T__level2_col2" class="col_heading level2 col2" >c2</th>
        </tr>
        <tr>
          <th class="index_name level0" >i-0</th>
          <th class="index_name level2" >i-2</th>
          <th class="blank col0" >&nbsp;</th>
          <th class="blank col1" >&nbsp;</th>
          <th class="blank col2" >&nbsp;</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th id="T__level0_row0" class="row_heading level0 row0" rowspan="2">i0</th>
          <th id="T__level2_row0" class="row_heading level2 row0" >i2</th>
          <td id="T__row0_col0" class="data row0 col0" >0</td>
          <td id="T__row0_col1" class="data row0 col1" >1</td>
          <td id="T__row0_col2" class="data row0 col2" >2</td>
        </tr>
        <tr>
          <th id="T__level2_row1" class="row_heading level2 row1" >j2</th>
          <td id="T__row1_col0" class="data row1 col0" >4</td>
          <td id="T__row1_col1" class="data row1 col1" >5</td>
          <td id="T__row1_col2" class="data row1 col2" >6</td>
        </tr>
        <tr>
          <th id="T__level0_row2" class="row_heading level0 row2" >j0</th>
          <th id="T__level2_row2" class="row_heading level2 row2" >i2</th>
          <td id="T__row2_col0" class="data row2 col0" >8</td>
          <td id="T__row2_col1" class="data row2 col1" >9</td>
          <td id="T__row2_col2" class="data row2 col2" >10</td>
        </tr>
      </tbody>
    </table>
    )
r   r#   r   r$   r%   r&   r	   r   r;   r   )r'   r   r]   r   r6   r=   s         r   .test_hiding_index_columns_multiindex_alignmentr  a  sF   "
vd|,4I4I4I  D "
$d|,4I4I4I  D 
29R==((A..dD	I	I	IBB###F
KKaaK  %%AA%666
KK#$1K---
KK#$1K---^^F1	3 3Hh Xr   c                  T   t          t          j        d                              dd                    } t	          j        g dddgg          | _        t	          j        g dddgg          | _        ddgdd	gc| j        _        | j        _        t          | d
d          }|
                    g dd          
                    g dd           t          dddd          5  |                                }d d d            n# 1 swxY w Y   t          d          }||k    sJ d S )N@   r   )r   rQ   rR   r   r   rQ   r   r   r   r    F)rZ   r   ))r   r   )r   rQ   )rQ   r   r   zstyler.render.max_rowsr"   zstyler.render.max_columnsa      <style type="text/css">
    </style>
    <table id="T_">
      <thead>
        <tr>
          <th class="blank" >&nbsp;</th>
          <th class="index_name level0" >c</th>
          <th class="col_heading level0 col3" >1</th>
          <th class="col_heading level0 col4" colspan="2">2</th>
          <th class="col_heading level0 col6" >3</th>
        </tr>
        <tr>
          <th class="blank" >&nbsp;</th>
          <th class="index_name level1" >d</th>
          <th class="col_heading level1 col3" >1</th>
          <th class="col_heading level1 col4" >0</th>
          <th class="col_heading level1 col5" >1</th>
          <th class="col_heading level1 col6" >0</th>
          <th class="col_heading level1 col_trim" >...</th>
        </tr>
        <tr>
          <th class="index_name level0" >a</th>
          <th class="index_name level1" >b</th>
          <th class="blank col3" >&nbsp;</th>
          <th class="blank col4" >&nbsp;</th>
          <th class="blank col5" >&nbsp;</th>
          <th class="blank col6" >&nbsp;</th>
          <th class="blank col7 col_trim" >&nbsp;</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="row_heading level0 row3" >1</th>
          <th class="row_heading level1 row3" >1</th>
          <td class="data row3 col3" >27</td>
          <td class="data row3 col4" >28</td>
          <td class="data row3 col5" >29</td>
          <td class="data row3 col6" >30</td>
          <td class="data row3 col_trim" >...</td>
        </tr>
        <tr>
          <th class="row_heading level0 row4" rowspan="2">2</th>
          <th class="row_heading level1 row4" >0</th>
          <td class="data row4 col3" >35</td>
          <td class="data row4 col4" >36</td>
          <td class="data row4 col5" >37</td>
          <td class="data row4 col6" >38</td>
          <td class="data row4 col_trim" >...</td>
        </tr>
        <tr>
          <th class="row_heading level1 row5" >1</th>
          <td class="data row5 col3" >43</td>
          <td class="data row5 col4" >44</td>
          <td class="data row5 col5" >45</td>
          <td class="data row5 col6" >46</td>
          <td class="data row5 col_trim" >...</td>
        </tr>
        <tr>
          <th class="row_heading level0 row6" >3</th>
          <th class="row_heading level1 row6" >0</th>
          <td class="data row6 col3" >51</td>
          <td class="data row6 col4" >52</td>
          <td class="data row6 col5" >53</td>
          <td class="data row6 col6" >54</td>
          <td class="data row6 col_trim" >...</td>
        </tr>
        <tr>
          <th class="row_heading level0 row_trim" >...</th>
          <th class="row_heading level1 row_trim" >...</th>
          <td class="data col3 row_trim" >...</td>
          <td class="data col4 row_trim" >...</td>
          <td class="data col5 row_trim" >...</td>
          <td class="data col6 row_trim" >...</td>
          <td class="data row_trim col_trim" >...</td>
        </tr>
      </tbody>
    </table>
    )r   r$   r%   r&   r   r#   r   r   r   r	   r   r   r;   r   )r]   r   r6   r=   s       r   -test_hiding_index_columns_multiindex_trimmingr    s|   	29R==((A..	/	/B(,,,A)?@@BJ&q!f'=>>BH(+SzC:$BHNBJ$B333F
KK(((qK11667O7O7OVW6XXX	0!5PRS	T	T " "!!" " " " " " " " " " " " " " " N	P PHd Xs   %DD
D
typerV   ztext, exp, found))zno link, just textFr@   )zsubdomain not www: sub.web.comFr@   )z www subdomain: www.web.com otherTzwww.web.com)z)scheme full structure: http://www.web.comTzhttp://www.web.com)z#scheme no top-level: http://www.webTzhttp://www.web)z no scheme, no top-level: www.webFzwww.web)z!https scheme: https://www.web.comTzhttps://www.web.com)zftp scheme: ftp://www.webTzftp://www.web)zftps scheme: ftps://www.webTzftps://www.web)z%subdirectories: www.web.com/directoryTzwww.web.com/directory)zMultiple domains: www.1.2.3.4Tzwww.1.2.3.4)zwith port: http://web.com:80Tzhttp://web.com:80)z-full net_loc scheme: http://user:pass@web.comTzhttp://user:pass@web.com)z8with valid special chars: http://web.com/,.':;~!@#$*()[]Tzhttp://web.com/,.':;~!@#$*()[]c                     | dk    r,t          |g          }|j                            d          }n.t          dg|g          }|j                            d          }d| d| d}|                                }||v |u sJ ||v |usJ d S )	NrV   html
hyperlinksr   )r   z	<a href="z" target="_blank">z</a>)r   rv   rM   format_indexr;   )r  textexpfoundr]   r   renderedr6   s           r   test_rendered_linksr(    s    : v~ :vF33s4&)))&&&&99?5??E???H^^F3&&&&FN3&&&&&&r   c                     d} t           dj        |  g          }|j                            d                                          }d}| D ]}|                    |          |v sJ |                    d          |vsJ d S )N)zwww.a.bz
http://a.czhttps://a.dz	ftp://a.eztext {} {} text {} {}r   r!  z%<a href="{0}" target="_blank">{0}</a>r$  )r   rM   rv   r;   )linksr]   r6   hreflinks        r   test_multiple_rendered_linksr-  0  s    AE	2+2E:;	<	<BX___//7799F2D + +{{4  F*****;;vf,,,,,,r   c                    | j                             dg          j        }|                     |                              d           |                                 }d}t          d| d| d| d| d| d	| d
          }||v sJ d S )NmeanXfoot0_    <tr>
      <th id="T_X_level0_row1" class="row_heading level0 row1" >b</th>
      <td id="T_X_row1_col0" class="data row1 col0" >2.690000</td>
    </tr>
    <tr>
      <th id="T_X_level0_row0" class="row_heading level0 #row0" >mean</th>
      <td id="T_X_row0_col0" class="data z<row0 col0" >2.650000</td>
    </tr>
  </tbody>
</table>
    )rV   aggrv   concatrH   r;   r   )r   otherr6   fpr=   s        r   test_concatr<  ;  s    KOOVH%%+E
MM%!!#&&&^^F	B	 	 	 ,.	 	 CE	 	 	 	 *,	 	 35	 	 	 H vr   c                    | j         }| }t          |                    dg          d          }t          |                    dg          d          }|                    |                    |                                        d           |                                 }d}d}t          d| d	| d
| d| d| d| d| d	| d
| d| d| d| d          }||v sJ d S )Nr/  r   	precisionr"   r0  r1  foot0_foot0_r2  r3  r4  r5  r6  r7  Crow0 col0" >2.650</td>
    </tr>
    <tr>
      <th id="T_X_level0_:row0 col0" >2.6500</td>
    </tr>
  </tbody>
</table>
    rV   r	   r8  r9  rH   r;   r   	r   r]   styler1styler2styler3r6   fp1fp2r=   s	            r   test_concat_recursionrJ  Q  s   	BGRVVVH%%333GRVVVH%%333GNN7>>'**++44S999^^F C
C	 	 	 -0	 	 EH	 	 	 	 +.	 	 58	 	 	 	 -0	 	 EH	 	 	 	 +.	 	 58	 	 	 H$ vr   c                    | j         }| }t          |                    dg          d          }t          |                    dg          d          }|                    |                              |                              d           |                                 }d}d}t          d| d	| d
| d| d| d| d| d	| d
| d| d| d| d          }||v sJ d S )Nr/  r   r>  r"   r0  r1  foot1_r2  r3  r4  r5  r6  r7  rA  rB  rC  rD  s	            r   test_concat_chainrM  q  s   	BGRVVVH%%333GRVVVH%%333GNN7""7++44S999^^F
C
C	 	 	 -0	 	 EH	 	 	 	 +.	 	 58	 	 	 	 -0	 	 EH	 	 	 	 +.	 	 58	 	 	 H$ vr   c                     dt           fd} t          dgdggddgdg          }|j                            d	
          }|j                            d
          }|j                            d
          }|j                            d
          }|                    |                              |                    |                                        d                                          }t          d          }t          d           | d          z    | d          z    | d          z    | d          z   t          d          z   }||z   |k    sJ d S )Nfoot_prefixc                     |                      d          s| dk    sJ | }t          t          d| d| d| d| d| d| d	| d
| d| d| d| d| d          d          S )NrW   r@   z*        <tr>
          <th id="T_X_level0_r3  r4  z$row0" >a</th>
          <td id="T_X_r6  r7  zRrow0 col0" >2.610000</td>
        </tr>
        <tr>
          <th id="T_X_level0_zrow1" class="z$row1" >b</th>
          <td id="T_X_zrow1_col0" class="z0row1 col0" >2.690000</td>
        </tr>
        z    )prefix)endswithr   r   )rO  r;  s     r   
html_linesz(test_concat_combined.<locals>.html_lines  s   ##C((=K2,====	 	 	/1	 	FH	 	 	 	 .0	 	 79	 	 !	 	 02	 	 GI	 	 	 	 .0	 	 79	 	 	  
 
 
 	
r   r   r   r   r   r   r   red)colorgreenblueyellowr0  ag          <style type="text/css">
        #T_X_row1_col0 {
          background-color: red;
        }
        #T_X_foot0_row1_col0 {
          background-color: green;
        }
        #T_X_foot1_row1_col0 {
          background-color: blue;
        }
        #T_X_foot1_foot0_row1_col0 {
          background-color: yellow;
        }
        </style>
        a"              <table id="T_X">
              <thead>
                <tr>
                  <th class="blank level0" >&nbsp;</th>
                  <th id="T_X_level0_col0" class="col_heading level0 col0" >A</th>
                </tr>
              </thead>
              <tbody>
            r@   r1  rL  foot1_foot0_z8              </tbody>
            </table>
            )r   r   rv   highlight_maxr9  rH   r;   r   )	rS  r]   s1s2s3s4r6   expected_cssr   s	            r   test_concat_combinedr`    s   
 
 
 
 
& 
TFTF#C:u	E	E	EB			e		,	,B			g		.	.B			f		-	-B			h		/	/BYYr]]!!"))B--0099#>>FFHHF	 L& 			
 	
 *R..	 *X

	 *X

	 *^
$
$	%  
 
!	
 0 .(F222222r   c                     t          dg dt          j        dg          }|j                            d                              d          }d}||k    sJ d S )	NrQ   r   )r   r   r   -)na_reptest)
table_uuida  <style type="text/css">
</style>
<table id="T_test">
  <thead>
    <tr>
      <th class="blank level0" >&nbsp;</th>
      <th id="T_test_level0_col0" class="col_heading level0 col0" >a</th>
      <th id="T_test_level0_col1" class="col_heading level0 col1" >b</th>
      <th id="T_test_level0_col2" class="col_heading level0 col2" >c</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th id="T_test_level0_row0" class="row_heading level0 row0" >0</th>
      <td id="T_test_row0_col0" class="data row0 col0" >1</td>
      <td id="T_test_row0_col1" class="data row0 col1" >[1, 2, 3]</td>
      <td id="T_test_row0_col2" class="data row0 col2" >-</td>
    </tr>
  </tbody>
</table>
)r   r$   nanrv   rM   r;   )datapathr]   r6   r=   s       r   #test_to_html_na_rep_non_scalar_datarh    sh    	!)))"&99:	;	;BX__C_((00F0CCFH, Xr   )8textwrapr   r   numpyr$   r   r   r   r   r   importorskipr   pandas.io.formats.styler	   fixturer   r   r(   r-   r0   r7   r>   rO   r^   r`   rf   rj   rn   rq   rt   r   r   r   r   markparametrizer   r   r   r   r   r   r   r  r  r  r  r  r  r(  r-  r<  rJ  rM  r`  rh  r   r   r   <module>rp     s         
               
	X	&	& * * * * * *    P P P T T T
 . . . . . .4 4 4     F)( )( )(XY Y YY Y Y' ' 'T" " "1 1 19 9 96 6 6% % %<V V V(V V V,= = =
 5$-00UDM22e}55! ! 65 32 10!H 5$-00UDM22U U 32 10U@ 5$-00UDM22QC%%#899T T :9 32 10T>& & &
 "@@@  	 " 4-00T5M22G G 32 10G> $//$//- - 0/ 0/-B B BJ% % %*% % %*% % %*B B BJ] ] ]@ &'!233   6' '7  438'- - -  ,  @  <E3 E3 E3P    r   