Current File : //opt/imh-python/lib/python2.7/site-packages/tabulate.pyo
�
�!Uc@s6	dZddlmZddlmZddlmZddlmZddlZe�ddkr�dd	l	m
Z
dd
lmZe
e�ZeZeZeZeZeZd�Zneddl	mZ
dd
lmZmZe
e�ZeZeZeZeZeZddlZd�ZdddgZdZ dZ!edddddg�Z"eddddg�Z#eddddddd d!d"g�Z$d#�Z%d$�Z&d%�Z'd&�Z(e)d'�Z*id(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6Z+d@�Z,i
e$dAe"dBdCdDdB�dEe"dBdCdDdB�dFedGe"dBdCdDdB�dHe#dBdDdB�dIe#dBdDdB�dJddKddg�dL6e$dAedEedFedGedHe#dBdDdB�dIe#dBdDdB�dJddKe�dM6e$dAe"dNdCdNdN�dEe"dNdOdNdN�dFe"dNdCdNdN�dGe"dNdCdNdN�dHe#dPdPdP�dIe#dPdPdP�dJdQdKe�dR6e$dAe"dSdTdUdV�dEe"dWdTdXdY�dFe"dZd[d\d]�dGe"d^dTd_d`�dHe#dadada�dIe#dadada�dJdQdKe�db6e$dAe&dEe&dFedGedHe#dPdPdP�dIe#dPdPdP�dJdQdKdg�dc6e$dAedEe"dPdCdNdP�dFedGedHe#dPdPdP�dIe#dPdPdP�dJdQdKe�dd6e$dAe"dNdCdNdN�dEe"dPdCdNdP�dFedGe"dNdCdNdN�dHe#dPdPdP�dIe#dPdPdP�dJdQdKe�de6e$dAe"dBdOdDdB�dEe"dBdOdDdB�dFedGe"dBdOdDdB�dHe#dBdDdB�dIe#dBdDdB�dJddKe�df6e$dAe"dgdBdBdh�dEe"didBdBdB�dFe"didBdBdB�dGe"djdBdBdB�dHee'dk�dIee'dP�dJddKe�dl6e$dAe"dmdBdBdB�dEedFedGe"dndBdBdB�dHee(do�dIee(dp�dJddKe�dq6e$dAe*dEe"drdBdBdB�dFedGe"dsdBdBdB�dHe,dIe,dJdQdKe�dt6e$dAee*due-�dEe"dvdBdBdB�dFedGe"dwdBdBdB�dHe,dIe,dJdQdKe�dx6e$dAedEedFedGedHe#dBdydB�dIe#dBdydB�dJddKe�dz6Z.e/e0e.j1���Z2ej3d{�Z4ej3d|�Z5d}�Z6d~�Z7d�Z8ed��Z9e-d��Z:d��Z;e-d��Z<e-d��Z=e-d��Z>d��Z?d��Z@de-d��ZAd��ZBe-d��ZCdBe-d��ZDd��ZEd��ZFfdLd�d�d�dBd��ZGd��ZHd��ZId��ZJd��ZKd��ZLd��ZMd��ZNeOd�kr2	eM�ndS(�uPretty-print tabular data.i����(tprint_function(tunicode_literals(t
namedtuple(tpython_version_tupleNiu3(tizip_longest(tpartialcCs
t|t�S(N(t
isinstancetfile(tf((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_is_files(tzip_longest(treduceRcCst|tj�S(N(RtiotIOBase(R((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyR	$sutabulateutabulate_formatsusimple_separated_formatu0.7.5iuLineubeginuhlineusepuenduDataRowuTableFormatu	lineaboveulinebelowheaderulinebetweenrowsu	linebelowu	headerrowudatarowupaddinguwith_header_hidecCsj|}|d
kr"d|ddS|dkrBdd|ddS|dkr^dd|dSd|Sd	S(u~Return a segment of a horizontal line with optional colons which
    indicate column's alignment (as in `pipe` output format).urightudecimalu-iu:ucenteriuleftN(urightudecimal((taligntcolwidthtw((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_pipe_segment_with_colonsZscCsFgt||�D]\}}t||�^q}ddj|�dS(unReturn a horizontal line with optional colons to indicate column's
    alignment (as in `pipe` output format).u|(tzipRtjoin(t	colwidthst	colalignstaRtsegments((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_pipe_line_with_colonshs1c	Cs�idd6dd6dd6dd6}gt||�D]*\}}d|j|d�|d^q2}|d	}||j|�j�S(
Nuuleftualign="right"| urightualign="center"| ucenterudecimalu i(RtgetRtrstrip(	t	separatortcell_valuesRRt	alignmenttcRtvalues_with_attrstcolsep((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_mediawiki_row_with_attrsos

=
cCs�idd6dd6dd6dd6}gt||�D]-\}}dj||j|d�|�^q2}d	dj|�j�d
S(Nuuleftu style="text-align: right;"urightu style="text-align: center;"ucenterudecimalu<{0}{1}>{2}</{0}>u<tr>u</tr>(RtformatRRR(tcelltagRRRRRRR((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_html_row_with_attrs|s

@cCswidd6dd6dd6dd6}djg|D]}|j|d�^q/�}d	jd
|d|rmdnd
g�S(Nululeftururightucucenterudecimaluu
u\begin{tabular}{u}u\topruleu\hline(RR(RRtbooktabsRRttabular_columns_fmt((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_latex_line_begin_tabular�s".u\&u&u\%u%u\$u$u\#u#u\_u_u\^{}u^u\{u{u\}u}u\textasciitilde{}u~u\textbackslash{}u\u\ensuremath{<}u<u\ensuremath{>}u>cCsSd�}g|D]}djt||��^q}tddd�}t||�S(NcSstj||�S(N(tLATEX_ESCAPE_RULESR(R((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pytescape_char�suu&u\\(RtmaptDataRowt_build_simple_row(RRRR)tcelltescaped_valuestrowfmt((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt
_latex_row�s	+t	lineaboveuu-u  tlinebelowheadertlinebetweenrowst	linebelowt	headerrowtdatarowtpaddingtwith_header_hideusimpleuplainu+u=u|iugridu╒u═u╤u╕u╞u╪u╡u├u─u┼u┤u╘u╧u╛u│u
fancy_gridupipeuorgtblupsqlurstu.{| class="wikitable" style="text-align: left;"u
|+ <!-- caption -->
|-u|-u|}u!u	mediawikiu<table>u</table>uthutduhtmlu\hlineu\hline
\end{tabular}ulatexR%u\midruleu\bottomrule
\end{tabular}ulatex_booktabsu	utsvu\x1b\[\d*m|\x1b\[\d*\;\d*\;\d*ms\[\d*m|\[\d*\;\d*\;\d*mc
CsCtdddddtd|d�dtd|d�dddd�S(u�Construct a simple TableFormat with columns separated by a separator.

    >>> tsv = simple_separated_format("\t") ;         tabulate([["foo", 1], ["spam", 23]], tablefmt=tsv) == 'foo \t 1\nspam\t23'
    True

    R5uR6R7iR8N(tTableFormattNoneR+(R((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pytsimple_separated_format
scCs3y||�}tSWnttfk
r.tSXdS(N(tTruet
ValueErrort	TypeErrortFalse(tconvtstringtn((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_isconvertibles
cCs
tt|�S(up
    >>> _isnumber("123.45")
    True
    >>> _isnumber("123")
    True
    >>> _isnumber("spam")
    False
    (RCtfloat(RA((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt	_isnumber s	cCs=t|�|kp<t|t�s0t|t�o<t||�S(uG
    >>> _isint("123")
    True
    >>> _isint("123.45")
    False
    (ttypeRt_binary_typet
_text_typeRC(RAtinttype((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_isint,scCs�|r3t|t�s$t|t�r3t|�}n|dkrCtSt|d�rVtSt|�rftSt|t	�ryt	St
|�r�tSt|t�r�tStSdS(u%The least generic type (type(None), int, float, str, unicode).

    >>> _type(None) is type(None)
    True
    >>> _type("foo") is type("")
    True
    >>> _type("1") is type(1)
    True
    >>> _type('42') is type(42)
    True
    >>> _type('42') is type(42)
    True

    u	isoformatN(RRHRGt_strip_invisibleR:t
_none_typethasattrRJtintt
_long_typeRERD(RAt
has_invisible((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_type9s cCst|�rwt|�rdS|jd�}|dkrL|j�jd�n|}|dkrpt|�|dSdSndSdS(u�Symbols after a decimal point, -1 if the string lacks the decimal point.

    >>> _afterpoint("123.45")
    2
    >>> _afterpoint("1001")
    -1
    >>> _afterpoint("eggs")
    -1
    >>> _afterpoint("123e45")
    2

    i����u.iueiN(RERJtrfindtlowertlen(RAtpos((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_afterpoint]s
'cCsC|r&|t|�tt|��n|}d|}|j|�S(uLFlush right.

    >>> _padleft(6, 'яйца') == '  яйца'
    True

    u{0:>%ds}(RTRKR"(twidthtsRPtiwidthtfmt((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_padleftxs,
cCsC|r&|t|�tt|��n|}d|}|j|�S(uLFlush left.

    >>> _padright(6, 'яйца') == 'яйца  '
    True

    u{0:<%ds}(RTRKR"(RWRXRPRYRZ((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt	_padright�s,
cCsC|r&|t|�tt|��n|}d|}|j|�S(uNCenter string.

    >>> _padboth(6, 'яйца') == ' яйца '
    True

    u{0:^%ds}(RTRKR"(RWRXRPRYRZ((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_padboth�s,
cCs9t|t�r"tjtd|�Stjtd|�SdS(u"Remove invisible ANSI color codes.uN(RRHtretsubt_invisible_codest_invisible_codes_bytes(RX((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyRK�scCsBt|t�st|t�r.tt|��Stt|��SdS(u�Visible width of a printed string. ANSI color codes are removed.

    >>> _visible_width('hello'), _visible_width("world")
    (5, 5)

    N(RRHRGRTRK(RX((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_visible_width�scCs�|dkr4g|D]}|j�^q}t}n|dkrhg|D]}|j�^qG}t}n�|dkr
|r�g|D]}tt|��^q�}ng|D]}t|�^q�}t|�}gt||�D]\}}|||d^q�}t}n/|s|Sg|D]}|j�^q}t}|rHt}	nt	}	ttt
|	|��|�}
g|D]}||
||�^qs}|S(uJ[string] -> [padded_string]

    >>> list(map(str,_align_column(["12.345", "-1234.5", "1.23", "1234.5", "1e+234", "1.0e234"], "decimal")))
    ['   12.345  ', '-1234.5    ', '    1.23   ', ' 1234.5    ', '    1e+234 ', '    1.0e234']

    >>> list(map(str,_align_column(['123.4', '56.7890'], None)))
    ['123.4', '56.7890']

    urightucenterudecimalu (tstripR[R]RVRKtmaxRR\RbRTR*(tstringsRtminwidthRPRXtpadfntdecimalstmaxdecimalstdecstwidth_fntmaxwidthtpadded_strings((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt
_align_column�s0
		(1		%cCs�idt6dt6dt6dt6dt6}itd6td6td6td6td6}t|j|d�|j|d��}||S(Niiiii(RLRNRDRGRHRdR(ttype1ttype2ttypestinvtypestmoregeneric((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt
_more_generic�s))'cCs2g|D]}t||�^q}tt|t�S(u"The least generic type all column values are convertible to.

    >>> _column_type(["1", "2"]) is _int_type
    True
    >>> _column_type(["1", "2.3"]) is _float_type
    True
    >>> _column_type(["1", "2.3", "four"]) is _text_type
    True
    >>> _column_type(["four", 'пять']) is _text_type
    True
    >>> _column_type([None, "brux"]) is _text_type
    True
    >>> _column_type([1, 2, None]) is _int_type
    True
    >>> import datetime as dt
    >>> _column_type([dt.datetime(1991,2,19), dt.time(17,35)]) is _text_type
    True

    (RQRRtRN(ReRPRXRq((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_column_type�s"cCs�|dkr|S|tttgkr2dj|�S|tkrmyt|d�SWq�tk
rit|�SXn�|tkr�|o�t|ttf�}|r�t	|�}tt|�|�}|j
||�Stt|�|�Sn
dj|�SdS(u�Format a value accoding to its type.

    Unicode is supported:

    >>> hrow = ['буква', 'цифра'] ;         tbl = [['аз', 2], ['буки', 4]] ;         good_result = '\u0431\u0443\u043a\u0432\u0430      \u0446\u0438\u0444\u0440\u0430\n-------  -------\n\u0430\u0437             2\n\u0431\u0443\u043a\u0438           4' ;         tabulate(tbl, headers=hrow) == good_result
    True

    u{0}uasciiN(R:RNRORHR"RGR>RDRRKtreplace(tvaltvaltypetfloatfmtt
missingvalRPtis_a_colored_numbertraw_valt
formatted_val((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_format�s"

cCsV|dkrt||�S|dkr2t||�S|sEdj|�St||�SdS(Nuleftucenteru{0}(R\R]R"R[(theaderRRW((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt
_align_headers


c
Cs�t|d�r�t|d�r�t|jd�rW|j�}tt|j���}nqt|d�r�|j�}|j}|j}gt||�D]\}}|gt|�^q�}ntd��|dkr�ttt	|��}q�n�t|�}|dkr7t|d�r7t
|jd�r7|jj}n�|dkr�t
|�dkr�t|dt�r�t|dd	�r�ttt	|dj��}n8t
|�dkr�t|dt�r�t�}g}|d
kr)t
|�dkr�|dni}	|j|	j��|j|�|d}nxN|D]F}x=|j�D]/}
|
|krC|j|
�|j|
�qCqCWq0W|dkr�|}n�t|t�r�g|D]}
|j|
|
�^q�}ttt	|��}ny|d
kr?t
|�dkr6g|D]}
|	j|
|
�^q}ttt	|��}qTg}n|rTtd��ng|D](}g|D]}
|j|
�^qh^q[}nF|dkr�t
|�dkr�ttt	tt
|d����}n|d
krt
|�dkrttt	|d��}|d}nttt	|��}ttt|��}|r�t
|�dkr�t
|�}t
|d�}||kr�d
g|||}q�n||fS(u�Transform a supported data type to a list of lists, and a list of headers.

    Supported tabular data types:

    * list-of-lists or another iterable of iterables

    * list of named tuples (usually used with headers="keys")

    * list of dicts (usually used with headers="keys")

    * list of OrderedDicts (usually used with headers="keys")

    * 2D NumPy arrays

    * NumPy record arrays (usually used with headers="keys")

    * dict of iterables (usually used with headers="keys")

    * pandas.DataFrame (usually used with headers="keys")

    The first row can be used as headers if headers="firstrow",
    column indices can be used as headers if headers="keys".

    ukeysuvaluesu__call__uindexu7tabular data doesn't appear to be a dict or a DataFrameudtypeunamesiu_fieldsufirstrowiu6headers for a list of dicts is not a dict or a keywordu(RMtvaluestkeystlistRtindexRR=R*RHtgetattrtdtypetnamesRTRttuplet_fieldstdicttsettextendtupdatetappendtaddRtrange(
ttabular_datatheadersR�trowstvalsR�tvtrowt	uniq_keyst	firstdicttktnhstncols((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_normalize_tabular_data&s|		8	"



	%%	8(
ugudecimaluleftc
Cs�|dkrg}nt||�\}}djdjtt|��gg|D]}djtt|��^qO�}	tjt|	�}
|
r�t}nt	}t
t|��}t
tt|��}
gt||
�D]7\}}g|D]}t
|||||
�^q�^q�}g|
D]$}|ttgkr7|n|^q}|rlg|D])}||�t^qPndgt	|�}gt|||�D]$\}}}t||||
�^q�}|r�|p�dggt	|�}|p�|gt	|�}gt||�D]%\}}t|||d��^q}gt|||�D]!\}}}t|||�^qE}t
t|��}n5g|D]}||d�^q�}t
t|��}t|t�s�tj|td�}nt|||||�S(u�Format a fixed width table for pretty printing.

    >>> print(tabulate([[1, 2.34], [-56, "8.999"], ["2", "10001"]]))
    ---  ---------
      1      2.34
    -56      8.999
      2  10001
    ---  ---------

    The first required argument (`tabular_data`) can be a
    list-of-lists (or another iterable of iterables), a list of named
    tuples, a dictionary of iterables, an iterable of dictionaries,
    a two-dimensional NumPy array, NumPy record array, or a Pandas'
    dataframe.


    Table headers
    -------------

    To print nice column headers, supply the second argument (`headers`):

      - `headers` can be an explicit list of column headers
      - if `headers="firstrow"`, then the first row of data is used
      - if `headers="keys"`, then dictionary keys or column indices are used

    Otherwise a headerless table is produced.

    If the number of headers is less than the number of columns, they
    are supposed to be names of the last columns. This is consistent
    with the plain-text format of R and Pandas' dataframes.

    >>> print(tabulate([["sex","age"],["Alice","F",24],["Bob","M",19]],
    ...       headers="firstrow"))
           sex      age
    -----  -----  -----
    Alice  F         24
    Bob    M         19


    Column alignment
    ----------------

    `tabulate` tries to detect column types automatically, and aligns
    the values properly. By default it aligns decimal points of the
    numbers (or flushes integer numbers to the right), and flushes
    everything else to the left. Possible column alignments
    (`numalign`, `stralign`) are: "right", "center", "left", "decimal"
    (only for `numalign`), and None (to disable alignment).


    Table formats
    -------------

    `floatfmt` is a format specification used for columns which
    contain numeric data with a decimal point.

    `None` values are replaced with a `missingval` string:

    >>> print(tabulate([["spam", 1, None],
    ...                 ["eggs", 42, 3.14],
    ...                 ["other", None, 2.7]], missingval="?"))
    -----  --  ----
    spam    1  ?
    eggs   42  3.14
    other   ?  2.7
    -----  --  ----

    Various plain-text table formats (`tablefmt`) are supported:
    'plain', 'simple', 'grid', 'pipe', 'orgtbl', 'rst', 'mediawiki',
     'latex', and 'latex_booktabs'. Variable `tabulate_formats` contains the list of
    currently supported formats.

    "plain" format doesn't use any pseudographics to draw tables,
    it separates columns with a double space:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                 ["strings", "numbers"], "plain"))
    strings      numbers
    spam         41.9999
    eggs        451

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="plain"))
    spam   41.9999
    eggs  451

    "simple" format is like Pandoc simple_tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                 ["strings", "numbers"], "simple"))
    strings      numbers
    ---------  ---------
    spam         41.9999
    eggs        451

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="simple"))
    ----  --------
    spam   41.9999
    eggs  451
    ----  --------

    "grid" is similar to tables produced by Emacs table.el package or
    Pandoc grid_tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "grid"))
    +-----------+-----------+
    | strings   |   numbers |
    +===========+===========+
    | spam      |   41.9999 |
    +-----------+-----------+
    | eggs      |  451      |
    +-----------+-----------+

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="grid"))
    +------+----------+
    | spam |  41.9999 |
    +------+----------+
    | eggs | 451      |
    +------+----------+

    "fancy_grid" draws a grid using box-drawing characters:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "fancy_grid"))
    ╒═══════════╤═══════════╕
    │ strings   │   numbers │
    ╞═══════════╪═══════════╡
    │ spam      │   41.9999 │
    ├───────────┼───────────┤
    │ eggs      │  451      │
    ╘═══════════╧═══════════╛

    "pipe" is like tables in PHP Markdown Extra extension or Pandoc
    pipe_tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "pipe"))
    | strings   |   numbers |
    |:----------|----------:|
    | spam      |   41.9999 |
    | eggs      |  451      |

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="pipe"))
    |:-----|---------:|
    | spam |  41.9999 |
    | eggs | 451      |

    "orgtbl" is like tables in Emacs org-mode and orgtbl-mode. They
    are slightly different from "pipe" format by not using colons to
    define column alignment, and using a "+" sign to indicate line
    intersections:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "orgtbl"))
    | strings   |   numbers |
    |-----------+-----------|
    | spam      |   41.9999 |
    | eggs      |  451      |


    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="orgtbl"))
    | spam |  41.9999 |
    | eggs | 451      |

    "rst" is like a simple table format from reStructuredText; please
    note that reStructuredText accepts also "grid" tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "rst"))
    =========  =========
    strings      numbers
    =========  =========
    spam         41.9999
    eggs        451
    =========  =========

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="rst"))
    ====  ========
    spam   41.9999
    eggs  451
    ====  ========

    "mediawiki" produces a table markup used in Wikipedia and on other
    MediaWiki-based sites:

    >>> print(tabulate([["strings", "numbers"], ["spam", 41.9999], ["eggs", "451.0"]],
    ...                headers="firstrow", tablefmt="mediawiki"))
    {| class="wikitable" style="text-align: left;"
    |+ <!-- caption -->
    |-
    ! strings   !! align="right"|   numbers
    |-
    | spam      || align="right"|   41.9999
    |-
    | eggs      || align="right"|  451
    |}

    "html" produces HTML markup:

    >>> print(tabulate([["strings", "numbers"], ["spam", 41.9999], ["eggs", "451.0"]],
    ...                headers="firstrow", tablefmt="html"))
    <table>
    <tr><th>strings  </th><th style="text-align: right;">  numbers</th></tr>
    <tr><td>spam     </td><td style="text-align: right;">  41.9999</td></tr>
    <tr><td>eggs     </td><td style="text-align: right;"> 451     </td></tr>
    </table>

    "latex" produces a tabular environment of LaTeX document markup:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="latex"))
    \begin{tabular}{lr}
    \hline
     spam &  41.9999 \\
     eggs & 451      \\
    \hline
    \end{tabular}

    "latex_booktabs" produces a tabular environment of LaTeX document markup
    using the booktabs.sty package:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="latex_booktabs"))
    \begin{tabular}{lr}
    \toprule
     spam &  41.9999 \\
     eggs & 451      \\
    \bottomrule
    \end{tabular}
    u
u	iuusimpleN(R:R�RR*RHR^tsearchR`RbRTR�RRuR~RNRDtMIN_PADDINGRnRdR�RR9t_table_formatsRt
_format_table(R�R�ttablefmtRytnumaligntstralignRzt
list_of_listsR�t
plain_textRPRktcolstcoltypesRtctR�talignstht	minwidthsRtminwtt_colstt_alignsR�((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyttabulate�s:�	/	J1<:;7#cCs*|\}}}||j|�|j�S(u7Format row according to DataRow format without padding.(RR(tpadded_cellsR/tbegintseptend((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyR,�scCs:|s
dSt|d�r)||||�St||�SdS(u5Return a string which represents a row of data cells.u__call__N(R:RMR,(R�RRR/((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt
_build_row�s
c	Cso|s
dSt|d�r&|||�S|\}}}}g|D]}||^q?}t||||f�SdS(u3Return a string which represents a horizontal line.u__call__N(R:RMR,(	RRtlinefmtR�tfillR�R�Rtcells((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_build_line�s
cCs=|r5d|}g|D]}|||^q}|S|SdS(Nu ((R�R7tpadR-R�((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt_pad_row�s

!cCsg}|r|jr|jng}|j}|j}g|D]}	|	d|^q=}
t||�}g|D]}t||�^qm}
|jr�d|kr�|jt|
||j��n|r|jt||
||��|jrd|kr|jt|
||j��qn|
r�|j	r�d|kr�xM|
d D]A}|jt||
||j
��|jt|
||j	��q;W|jt|
d|
||j
��n0x-|
D]%}|jt||
||j
��q�W|jr
d|kr
|jt|
||j��ndj|�S(u1Produce a plain-text representation of the table.iu	lineaboveulinebelowheaderulinebetweenrowsi����u	linebelowu
(
R8R7R5R�R1R�R�R�R2R3R6R4R(RZR�R�RRtlinesthiddenR�R5Rt
padded_widthstpadded_headersR�tpadded_rows((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyR��s.		!"" &
#cCs�ddl}ddl}ddl}|jtj�}y8|j|jddddddd	d
g�\}}Wn7|jk
r�}t|�t|�|j	d�nXg}d}d
}	d}
d}x�|D]�\}}
|d&kr�d}q�|d'kr|
}q�|d(kr|
}q�|d)kra|
t
krXtd|
�t|�|j	d�n|
}	q�|d*krv|
}
q�|d+kr�t|�|j	d�q�q�W|s�|jgn|}|dkr�|jnt
|d ���}x�|D]�}|dkr|j}nt|�r;t|d!|d"|	d#|
d$|d%|�q�t
|��/}t|d!|d"|	d#|
d$|d%|�WdQXq�WWdQXdS(,u�    Usage: tabulate [options] [FILE ...]

    Pretty-print tabular data.
    See also https://bitbucket.org/astanin/python-tabulate

    FILE                      a filename of the file with tabular data;
                              if "-" or missing, read data from stdin.

    Options:

    -h, --help                show this message
    -1, --header              use the first row of data as a table header
    -o FILE, --output FILE    print table to FILE (default: stdout)
    -s REGEXP, --sep REGEXP   use a custom column separator (default: whitespace)
    -F FPFMT, --float FPFMT   floating point number format (default: g)
    -f FMT, --format FMT      set output table format; supported formats:
                              plain, simple, grid, fancy_grid, pipe, orgtbl,
                              rst, mediawiki, html, latex, latex_booktabs, tsv
                              (default: simple)
    i����Niu
h1o:s:F:f:uhelpuheaderuoutputusep=ufloat=uformat=iugusimpleu\s+u-u-1u--headerufirstrowu-ou--outputu-Fu--floatu-fu--formatu"%s is not a supported table formatiu-su--sepu-hu--helpiuwR�R�R�RyR(u-1u--header(u-ou--output(u-Fu--float(u-fu--format(u-su--sep(u-hu--help(tgetopttsysttextwraptdedentt_maint__doc__targvtGetoptErrortprinttexitttabulate_formatststdintstdouttopenR	t_pprint_file(R�R�R�tusagetoptstargsteR�RyR�R�toutfiletopttvaluetfilestoutRtfobj((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyR��s\%

			
		
'
c	Cs]|j�}g|D]}tj||j��^q}tt|||d|�d|�dS(NRyR(t	readlinesR^tsplitRR�R�(	tfobjectR�R�R�RyRR�trttable((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyR�8s+u__main__(PR�t
__future__RRtcollectionsRtplatformRR^t	itertoolsRt	functoolsRRFR:RLRNt	_int_typetlongRORDt_float_typetunicodeRHtstrRGR	R
RtbytesRt__all__t__version__R�tLineR+R9RRR!R$R?R'R(R0R<R�R�tsortedR�R�tcompileR`RaR;RCRERJRQRVR[R\R]RKRbRnRtRuR~R�R�R�R,R�R�R�R�R�R�t__name__(((s7/opt/imh-python/lib/python2.7/site-packages/tabulate.pyt<module>sP	"			
	
	
			
$			
)	"		o	�		
				$	G