ó
šxŠ\c           @   s¢  d  Z  d d l m Z d d l m Z d d l Z d d l Z d d l j Z d d l m	 Z	 m
 Z
 m Z e d d ƒ Z e d d	 ƒ Z i  Z i  Z i  Z d
 g Z d e e f d „  ƒ  YZ d „  Z e d „ Z d „  Z d e d „ Z e d „ Z d „  Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d Z  d Z! d Z" d Z# e e e  ƒ a$ e e e! ƒ a% e e e# ƒ a& e e e" ƒ Z' e e ƒ Z( d e f d „  ƒ  YZ) d d d d „ a+ d d d d „ Z, d  „  Z- d! „  Z. d" „  Z/ d# „  Z0 d$ „  Z1 d% „  Z2 d& „  Z3 d' „  Z4 d( e d) „ Z5 e d* „  ƒ Z6 d+ „  Z7 d, „  Z8 d- „  Z9 e7 e: ƒ Z; e7 e< ƒ Z= e7 e> ƒ Z? e7 e@ ƒ ZA e7 e jB ƒ ZC e8 e@ eD f ƒ ZE d. „  ZF d S(/   sò  
The config module holds package-wide configurables and provides
a uniform API for working with them.

Overview
========

This module supports the following requirements:
- options are referenced using keys in dot.notation, e.g. "x.y.option - z".
- keys are case-insensitive.
- functions should accept partial/regex keys, when unambiguous.
- options can be registered by modules at import time.
- options can be registered at init-time (via core.config_init)
- options have a default value, and (optionally) a description and
  validation function associated with them.
- options can be deprecated, in which case referencing them
  should produce a warning.
- deprecated options can optionally be rerouted to a replacement
  so that accessing a deprecated option reroutes to a differently
  named option.
- options can be reset to their default value.
- all option can be reset to their default value at once.
- all options in a certain sub - namespace can be reset at once.
- the user can set / get / reset or ask for the description of an option.
- a developer can register and mark an option as deprecated.
- you can register a callback to be invoked when the option value
  is set or reset. Changing the stored value is considered misuse, but
  is not verboten.

Implementation
==============

- Data is stored using nested dictionaries, and should be accessed
  through the provided API.

- "Registered options" and "Deprecated options" have metadata associated
  with them, which are stored in auxiliary dictionaries keyed on the
  fully-qualified key, e.g. "x.y.z.option".

- the config_init module is imported by the package's __init__.py file.
  placing any register_option() calls there will ensure those options
  are available as soon as pandas is loaded. If you use register_option
  in a module, it will only be available after that module is imported,
  which you should be aware of.

- `config_prefix` is a context_manager (for use with the `with` keyword)
  which can save developers some typing, see the docstring.

iÿÿÿÿ(   t
   namedtuple(   t   contextmanagerN(   t   lmapt   mapt   ut   DeprecatedOptions   key msg rkey removal_vert   RegisteredOptions   key defval doc validator cbt   allt   OptionErrorc           B   s   e  Z d  Z RS(   sP   Exception for pandas.options, backwards compatible with KeyError
    checks
    (   t   __name__t
   __module__t   __doc__(    (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR   E   s   c         C   sš   t  |  ƒ } t | ƒ d k rL | s1 t |  ƒ n  t d j d |  ƒ ƒ ‚ n  t | ƒ d k rm t d ƒ ‚ n  | d } | sŠ t | ƒ n  t | ƒ } | S(   Ni    s   No such keys(s): {pat!r}t   pati   s   Pattern matched multiple keys(   t   _select_optionst   lent   _warn_if_deprecatedR   t   formatt   _translate_key(   R   t   silentt   keyst   key(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _get_single_keyN   s    
c         C   s)   t  |  | ƒ } t | ƒ \ } } | | S(   N(   R   t	   _get_root(   R   R   R   t   roott   k(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _get_option`   s    c    
      O   sT  t  |  ƒ } | s# | d d k r2 t d ƒ ‚ n  | j d t ƒ } | rx d } t | j t | j ƒ  ƒ d ƒ ƒ ‚ n  xÕ t |  d  d  d … |  d d  d … ƒ D]ª \ } } t	 | | ƒ } t
 | ƒ } | rè | j rè | j | ƒ n  t | ƒ \ }	 } | |	 | <| j r¢ | r<t j d t ƒ  | j | ƒ Wd  QXqL| j | ƒ q¢ q¢ Wd  S(   Ni   i    s4   Must provide an even number of non-keyword argumentsR   s:   _set_option() got an unexpected keyword argument "{kwarg}"i   t   record(   R   t
   ValueErrort   popt   Falset	   TypeErrorR   t   listR   t   zipR   t   _get_registered_optiont	   validatorR   t   cbt   warningst   catch_warningst   True(
   t   argst   kwargst   nargsR   t   msgR   t   vR   t   oR   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _set_optionh   s&    (6
	t    c         C   sp   t  |  ƒ } t | ƒ d k r- t d ƒ ‚ n  t d ƒ } x | D] } | t | ƒ 7} q@ W| rh | GHn | Sd  S(   Ni    s   No such keys(s)R.   (   R   R   R   R   t   _build_option_description(   R   t   _print_descR   t   sR   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _describe_option‰   s    c         C   s›   t  |  ƒ } t | ƒ d k r- t d ƒ ‚ n  t | ƒ d k rl t |  ƒ d k  rl |  d k rl t d ƒ ‚ n  x( | D]  } t | t | j d | ƒqs Wd  S(   Ni    s   No such keys(s)i   i   R   s’   You must specify at least 4 characters when resetting multiple keys, use the special keyword "all" to reset all the options to their default valueR   (   R   R   R   R   R-   t   _registered_optionst   defval(   R   R   R   R   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _reset_option™   s    0c         C   s   t  |  d t ƒ} t | ƒ j S(   NR   (   R   R&   R!   R4   (   R   R   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   get_default_valª   s    t   DictWrapperc           B   s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   s0    provide attribute-style access to a nested dictR.   c         C   s*   t  j |  d | ƒ t  j |  d | ƒ d  S(   Nt   dt   prefix(   t   objectt   __setattr__(   t   selfR8   R9   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   __init__²   s    c         C   su   t  j |  d ƒ } | r% | d 7} n  | | 7} | |  j k re t |  j | t ƒ re t | | ƒ n t d ƒ ‚ d  S(   NR9   t   .s.   You can only set the value of existing options(   R:   t   __getattribute__R8   t
   isinstancet   dictR-   R   (   R<   R   t   valR9   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR;   ¶   s    
&c         C   s“   t  j |  d ƒ } | r% | d 7} n  | | 7} y t  j |  d ƒ | } Wn t k
 rh t d ƒ ‚ n Xt | t ƒ r… t | | ƒ St | ƒ Sd  S(   NR9   R>   R8   s   No such option(   R:   R?   t   KeyErrorR   R@   RA   R7   R   (   R<   R   R9   R+   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   __getattr__Â   s    
c         C   s   t  |  j j ƒ  ƒ S(   N(   R   R8   R   (   R<   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   __dir__Ð   s    (   R	   R
   R   R=   R;   RD   RE   (    (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR7   ¯   s
   		t   CallableDynamicDocc           B   s)   e  Z d  „  Z d „  Z e d „  ƒ Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   __doc_tmpl__t   __func__(   R<   t   funct   doc_tmpl(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR=   Þ   s    	c         O   s   |  j  | | Ž  S(   N(   RH   (   R<   R'   t   kwds(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   __call__â   s    c         C   sC   t  d d t ƒ} t t t j ƒ  ƒ ƒ } |  j j d | d | ƒ S(   NR   R0   t	   opts_desct	   opts_list(   R2   R   t   pp_options_listR   R3   R   RG   R   (   R<   RM   RN   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR   å   s    (   R	   R
   R=   RL   t   propertyR   (    (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyRF   Ü   s   		s;  
get_option(pat)

Retrieves the value of the specified option.

Available options:

{opts_list}

Parameters
----------
pat : str
    Regexp which should match a single option.
    Note: partial matches are supported for convenience, but unless you use the
    full option name (e.g. x.y.z.option_name), your code may break in future
    versions if new options with similar names are introduced.

Returns
-------
result : the value of the option

Raises
------
OptionError : if no such option exists

Notes
-----
The available options with its descriptions:

{opts_desc}
s@  
set_option(pat, value)

Sets the value of the specified option.

Available options:

{opts_list}

Parameters
----------
pat : str
    Regexp which should match a single option.
    Note: partial matches are supported for convenience, but unless you use the
    full option name (e.g. x.y.z.option_name), your code may break in future
    versions if new options with similar names are introduced.
value :
    new value of option.

Returns
-------
None

Raises
------
OptionError if no such option exists

Notes
-----
The available options with its descriptions:

{opts_desc}
s¡  
describe_option(pat, _print_desc=False)

Prints the description for one or more registered options.

Call with not arguments to get a listing for all registered options.

Available options:

{opts_list}

Parameters
----------
pat : str
    Regexp pattern. All matching keys will have their description displayed.
_print_desc : bool, default True
    If True (default) the description(s) will be printed to stdout.
    Otherwise, the description(s) will be returned as a unicode string
    (for testing).

Returns
-------
None by default, the description(s) as a unicode string if _print_desc
is False

Notes
-----
The available options with its descriptions:

{opts_desc}
s5  
reset_option(pat)

Reset one or more options to their default value.

Pass "all" as argument to reset all options.

Available options:

{opts_list}

Parameters
----------
pat : str/regex
    If specified only options matching `prefix*` will be reset.
    Note: partial matches are supported for convenience, but unless you
    use the full option name (e.g. x.y.z.option_name), your code may break
    in future versions if new options with similar names are introduced.

Returns
-------
None

Notes
-----
The available options with its descriptions:

{opts_desc}
t   option_contextc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s  
    Context manager to temporarily set options in the `with` statement context.

    You need to invoke as ``option_context(pat, val, [(pat, val), ...])``.

    Examples
    --------

    >>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
    ...     ...
    c         G   sm   t  | ƒ d d k o% t  | ƒ d k s7 t d ƒ ‚ n  t t | d  d  d … | d d  d … ƒ ƒ |  _ d  S(   Ni   i    s>   Need to invoke as option_context(pat, val, [(pat, val), ...]).i   (   R   R   R   R    t   ops(   R<   R'   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR=   †  s    (c         C   sh   g  |  j  D]$ \ } } | t | d t ƒf ^ q
 |  _ x* |  j  D] \ } } t | | d t ƒqA Wd  S(   NR   (   RR   R   R&   t   undoR-   (   R<   R   RB   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt	   __enter__  s    4c         G   s=   |  j  r9 x- |  j  D] \ } } t | | d t ƒq Wn  d  S(   NR   (   RS   R-   R&   (   R<   R'   R   RB   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   __exit__”  s    	(   R	   R
   R   R=   RT   RU   (    (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyRQ   y  s   		c         C   s  d d l  } d d l } |  j ƒ  }  |  t k rQ d } t | j d |  ƒ ƒ ‚ n  |  t k r~ d } t | j d |  ƒ ƒ ‚ n  | r‘ | | ƒ n  |  j d ƒ } xv | D]n }	 t t	 j
 d | j d |	 ƒ ƒ së t d	 j d
 |	 ƒ ƒ ‚ n  | j |	 ƒ r§ t d j d
 |	 ƒ ƒ ‚ q§ q§ Wt }
 d } xx t | d  ƒ D]f \ } } t |
 t ƒ syt | j d d j | |  ƒ ƒ ƒ ‚ n  | |
 k r’i  |
 | <n  |
 | }
 q6Wt |
 t ƒ s×t | j d d j | d  ƒ ƒ ƒ ‚ n  | |
 | d <t d |  d | d | d | d | ƒ t |  <d S(   sä  Register an option in the package-wide pandas config object

    Parameters
    ----------
    key       - a fully-qualified key, e.g. "x.y.option - z".
    defval    - the default value of the option
    doc       - a string description of the option
    validator - a function of a single argument, should raise `ValueError` if
                called with a value which is not a legal value for the option.
    cb        - a function of a single argument "key", which is called
                immediately after an option value is set/reset. key is
                the full name of the option.

    Returns
    -------
    Nothing.

    Raises
    ------
    ValueError if `validator` is specified and `defval` is not a valid value.

    iÿÿÿÿNs*   Option '{key}' has already been registeredR   s    Option '{key}' is a reserved keyR>   t   ^t   $s   {k} is not a valid identifierR   s   {k} is a python keywords5   Path prefix to option '{option}' is already an optiont   optionR4   t   docR"   R#   (   t   tokenizet   keywordt   lowerR3   R   R   t   _reserved_keyst   splitt   boolt   ret   matcht   NameR   t	   iskeywordt   _global_configt	   enumerateR@   RA   t   joinR   (   R   R4   RY   R"   R#   RZ   R[   R*   t   pathR   t   cursort   it   p(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   register_optionš  s>    #((c         C   sV   |  j  ƒ  }  |  t k r9 d } t | j d |  ƒ ƒ ‚ n  t |  | | | ƒ t |  <d S(   s3  
    Mark option `key` as deprecated, if code attempts to access this option,
    a warning will be produced, using `msg` if given, or a default message
    if not.
    if `rkey` is given, any access to the key will be re-routed to `rkey`.

    Neither the existence of `key` nor that if `rkey` is checked. If they
    do not exist, any subsequence access will fail as usual, after the
    deprecation warning is given.

    Parameters
    ----------
    key - the name of the option to be deprecated. must be a fully-qualified
          option name (e.g "x.y.z.rkey").

    msg - (Optional) a warning message to output when the key is referenced.
          if no message is given a default message will be emitted.

    rkey - (Optional) the name of an option to reroute access to.
           If specified, any referenced `key` will be re-routed to `rkey`
           including set/get/reset.
           rkey must be a fully-qualified option name (e.g "x.y.z.rkey").
           used by the default message if no `msg` is specified.

    removal_ver - (Optional) specifies the version in which this option will
                  be removed. used by the default message if no `msg`
                  is specified.

    Returns
    -------
    Nothing

    Raises
    ------
    OptionError - if key has already been deprecated.

    s6   Option '{key}' has already been defined as deprecated.R   N(   R\   t   _deprecated_optionsR   R   R   (   R   R*   t   rkeyt   removal_ver(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   deprecate_optionÝ  s
    'c         C   sd   |  t  k r |  g St t  j ƒ  ƒ } |  d k r5 | Sg  | D]$ } t j |  | t j ƒ r< | ^ q< S(   s]   returns a list of keys matching `pat`

    if pat=="all", returns all registered options
    R   (   R3   t   sortedR   R`   t   searcht   I(   R   R   R   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR     s    c         C   sB   |  j  d ƒ } t } x | d  D] } | | } q  W| | d f S(   NR>   iÿÿÿÿ(   R^   Rd   (   R   Rg   Rh   Rj   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR   "  s
    c         C   s   |  j  ƒ  }  |  t k S(   s6    Returns True if the given option has been deprecated (   R\   Rl   (   R   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _is_deprecated*  s    c         C   s+   y t  |  } Wn t k
 r" d SX| Sd S(   s±   
    Retrieves the metadata for a deprecated option, if `key` is deprecated.

    Returns
    -------
    DeprecatedOption (namedtuple) if key is deprecated, None otherwise
    N(   Rl   RC   t   None(   R   R8   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   _get_deprecated_option1  s
    	c         C   s   t  j |  ƒ S(   s¨   
    Retrieves the option metadata if `key` is a registered option.

    Returns
    -------
    RegisteredOption (namedtuple) if key is deprecated, None otherwise
    (   R3   t   get(   R   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR!   B  s    c         C   s'   t  |  ƒ } | r | j p |  S|  Sd S(   s‚   
    if key id deprecated and a replacement key defined, will return the
    replacement key, otherwise returns `key` as - is
    N(   Ru   Rm   (   R   R8   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR   M  s    c         C   s·   t  |  ƒ } | r³ | j r9 | j GHt j | j t ƒ nv d j d |  ƒ } | j rp | d j d | j ƒ 7} n  | j r• | d j d | j ƒ 7} n
 | d 7} t j | t ƒ t St	 S(   sŸ   
    Checks if `key` is a deprecated option and if so, prints a warning.

    Returns
    -------
    bool - True if `key` is deprecated, False otherwise.
    s   '{key}' is deprecatedR   s!    and will be removed in {version}t   versions   , please use '{rkey}' instead.Rm   s   , please refrain from using it.(
   Ru   R*   R$   t   warnt   FutureWarningR   Rn   Rm   R&   R   (   R   R8   R*   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR   Z  s    				
c         C   s  t  |  ƒ } t |  ƒ } t d ƒ j d |  ƒ } | j ra | d j | j j ƒ  j d ƒ ƒ 7} n
 | d 7} | r¢ | t d ƒ j d | j d t	 |  t
 ƒ ƒ 7} n  | rù | t d ƒ 7} | t d	 ƒ j d
 | j rÜ | j n d ƒ 7} | t d ƒ 7} n  | d 7} | S(   sE    Builds a formatted description of a registered option and prints it s   {k} R   s   
s   No description available.s0   
    [default: {default}] [currently: {current}]t   defaultt   currents   
    (Deprecateds   , use `{rkey}` instead.Rm   R.   t   )s   

(   R!   Ru   R   R   RY   Rf   t   stripR^   R4   R   R&   Rm   (   R   R,   R8   R1   (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyR/   w  s     	(

iP   c            sD  d d l  m ‰ d d l m } ‡  ‡ f d †  } g  } g  t |  ƒ D]! } | j d ƒ d k  rE | ^ qE } | rˆ | | d | ƒ 7} n  g  |  D]! } | j d ƒ d k r | ^ q }  xf | t |  ƒ d „  ƒ D]L \ } }	 g  t |	 ƒ D] } | t | ƒ d	 ^ qè }
 | | | |
 ƒ 7} qÏ Wd
 j | ƒ } | r<| GHn | Sd S(   sB    Builds a concise listing of available options, grouped by prefix iÿÿÿÿ(   t   wrap(   t   groupbyc      	      ss   |  r d |  d n d } ˆ d j  | ƒ ˆ  d | d d d t ƒ} | ro | d	 ro |  ro | d	 d
 | d	 <n  | S(   Ns   - s   .[R.   s   , t   initial_indentt   subsequent_indents     t   break_long_wordsiÿÿÿÿt   ](   Rf   R   (   t   namet   kst   pfxt   ls(   t   widthR~   (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   pp˜  s    R>   i    R.   c         S   s   |  |  j  d ƒ  S(   NR>   (   t   rfind(   t   x(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   <lambda>¦  s    i   s   
N(	   t   textwrapR~   t	   itertoolsR   Rp   t   findR   R   Rf   (   R   Rˆ   t   _printR   R‰   R‡   R‹   t   singlesR   t   gR…   R1   (    (   Rˆ   R~   s1   lib/python2.7/site-packages/pandas/core/config.pyRO   ’  s    4.%-c         #   s`   ‡  f d †  } t  } t } t } | t ƒ a | t ƒ a | t  ƒ a  d V| a | a | a  d S(   s°  contextmanager for multiple invocations of API with a common prefix

    supported API functions: (register / get / set )__option

    Warning: This is not thread - safe, and won't work properly if you import
    the API functions into your module using the "from x import y" construct.

    Example:

    import pandas.core.config as cf
    with cf.config_prefix("display.font"):
        cf.register_option("color", "red")
        cf.register_option("size", " 5 pt")
        cf.set_option(size, " 6 pt")
        cf.get_option(size)
        ...

        etc'

    will register options "display.font.color", "display.font.size", set the
    value of "display.font.size"... and so on.
    c            s   ‡  ‡ f d †  } | S(   Nc            s(   d j  d ˆ d |  ƒ } ˆ  | | | Ž S(   Ns   {prefix}.{key}R9   R   (   R   (   R   R'   RK   t   pkey(   RI   R9   (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   innerÒ  s    (    (   RI   R”   (   R9   (   RI   s1   lib/python2.7/site-packages/pandas/core/config.pyR~   Ñ  s    N(   Rk   t
   get_optiont
   set_optionRt   (   R9   R~   t   _register_optionR   R-   (    (   R9   s1   lib/python2.7/site-packages/pandas/core/config.pyt   config_prefix³  s    c            s   ‡  f d †  } | S(   s  

    Parameters
    ----------
    `_type` - a type to be compared against (e.g. type(x) == `_type`)

    Returns
    -------
    validator - a function of a single argument x , which raises
                ValueError if type(x) is not equal to `_type`

    c            s7   t  |  ƒ ˆ  k r3 d } t | j d ˆ  ƒ ƒ ‚ n  d  S(   Ns   Value must have type '{typ!s}'t   typ(   t   typeR   R   (   R‹   R*   (   t   _type(    s1   lib/python2.7/site-packages/pandas/core/config.pyR”   õ  s    (    (   R›   R”   (    (   R›   s1   lib/python2.7/site-packages/pandas/core/config.pyt   is_type_factoryç  s    c            st   t  ˆ  t t f ƒ rL t ˆ  ƒ ‰  d d l m } d j t | ˆ  ƒ ƒ ‰ n d j d ˆ  ƒ ‰ ‡  ‡ f d †  } | S(   sê   

    Parameters
    ----------
    `_type` - the type to be checked against

    Returns
    -------
    validator - a function of a single argument x , which raises
                ValueError if x is not an instance of `_type`

    iÿÿÿÿ(   t   pprint_thingt   |s   '{typ}'R™   c            s4   t  |  ˆ  ƒ s0 d } t | j d ˆ ƒ ƒ ‚ n  d  S(   Ns(   Value must be an instance of {type_repr}t	   type_repr(   R@   R   R   (   R‹   R*   (   R›   RŸ   (    s1   lib/python2.7/site-packages/pandas/core/config.pyR”     s    (   R@   t   tupleR   t   pandas.io.formats.printingR   Rf   R   R   (   R›   R   R”   (    (   R›   RŸ   s1   lib/python2.7/site-packages/pandas/core/config.pyt   is_instance_factoryý  s    c            s`   g  ˆ D] } t  | ƒ r | ^ q ‰  g  ˆ D] } t  | ƒ s, | ^ q, ‰ ‡  ‡ f d †  } | S(   Nc            s—   d d l  m } ˆ  ˆ k r“ t ‡  f d †  ˆ Dƒ ƒ s“ | d j t | ˆ ƒ ƒ ƒ } d } t ˆ ƒ ru | d 7} n  t | j d | ƒ ƒ ‚ q“ n  d  S(   Niÿÿÿÿ(   R   c         3   s   |  ] } | ˆ  ƒ Vq d  S(   N(    (   t   .0t   c(   R‹   (    s1   lib/python2.7/site-packages/pandas/core/config.pys	   <genexpr>"  s    Rž   s    Value must be one of {pp_values}s    or a callablet	   pp_values(   R¡   R   t   anyRf   R   R   R   R   (   R‹   R‰   R¥   R*   (   t	   callablest   legal_values(   R‹   s1   lib/python2.7/site-packages/pandas/core/config.pyR”     s    (   t   callable(   R¨   R¤   R”   (    (   R§   R¨   s1   lib/python2.7/site-packages/pandas/core/config.pyt   is_one_of_factory  s    %%c         C   s   t  |  ƒ s t d ƒ ‚ n  t S(   s»   

    Parameters
    ----------
    `obj` - the object to be checked

    Returns
    -------
    validator - returns True if object is callable
        raises ValueError otherwise.

    s   Value must be a callable(   R©   R   R&   (   t   obj(    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   is_callable6  s    (G   R   t   collectionsR    t
   contextlibR   R`   R$   t   pandas.compatt   compatR   R   R   R   R   Rl   R3   Rd   R]   t   AttributeErrorRC   R   R   R   R   R-   R&   R2   R5   R6   R:   R7   RF   t   _get_option_tmplt   _set_option_tmplt   _describe_option_tmplt   _reset_option_tmplR•   R–   t   reset_optiont   describe_optiont   optionsRQ   Rt   Rk   Ro   R   R   Rs   Ru   R!   R   R   R/   RO   R˜   Rœ   R¢   Rª   t   intt   is_intR_   t   is_boolt   floatt   is_floatt   strt   is_strt	   text_typet
   is_unicodet   bytest   is_textR¬   (    (    (    s1   lib/python2.7/site-packages/pandas/core/config.pyt   <module>1   sl   					!	-/" !C3								!4			