Module Expr Str Import alias Import alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpDiv Call NameLoad BinOpMult NameLoad Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return BinOpDiv Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Raise Call NameLoad Str Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpFloorDiv NameLoad Num Assign NameStore BinOpMod NameLoad Num If NameLoad body Return SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Return Call NameLoad ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad ListComp BinOpPow BinOpSub NameLoad NameLoad Num comprehension NameStore NameLoad If NameLoad body Assign NameStore BoolOpOr BinOpSub Call NameLoad NameLoad Num Num orelse Assign NameStore Call NameLoad NameLoad Return BinOpPow BinOpDiv NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore CompareGt Call NameLoad NameLoad Num If UnaryOpNot NameLoad body Assign NameStore Num If NameLoad body Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str orelse Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str orelse Assign NameStore Num If NameLoad body Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str orelse Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Assign NameStore Str If CompareGt NameLoad Num body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If CompareLt NameLoad Num body Assign NameStore Str Assign NameStore UnaryOpUSub NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Num If CompareGt NameLoad Num body Assign NameStore Num If CompareEq NameLoad Num body Assign NameStore Str orelse Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod NameLoad BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Return BinOpMod Str TupleLoad NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad body Expr Str If NameLoad body Return Call NameLoad NameLoad Str NameLoad NameLoad NameLoad orelse Return Call NameLoad NameLoad Str NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad body Expr Str If NameLoad body Return Call NameLoad NameLoad Str NameLoad NameLoad NameLoad orelse Return Call NameLoad NameLoad Str NameLoad NameLoad NameLoad decorator_list
N/A N/A Number formatting, numeric helpers, and numeric statistics. N/A math N/A re percent_of N/A N/A part whole N/A N/A N/A What percent of ``whole`` is ``part``?
     N/A N/A N/A float N/A part 100 whole N/A mean N/A N/A r N/A N/A N/A Return the mean (i.e., average) of a sequence of numbers.
     N/A N/A N/A N/A N/A float N/A sum r N/A len r N/A N/A N/A ZeroDivisionError N/A N/A N/A ValueError can't calculate mean of empty collection N/A N/A average mean median N/A N/A r N/A N/A N/A Return the median of an iterable of numbers.

    The median is the point at which half the numbers are lower than it and
    half the numbers are higher.  This gives a better sense of the majority
    level than the mean (average) does, because the mean can be skewed by a few
    extreme numbers at either end.  For instance, say you want to calculate
    the typical household income in a community and you've sampled four
    households:

    >>> incomes = [18000]       # Fast food crew
    >>> incomes.append(24000)   # Janitor
    >>> incomes.append(32000)   # Journeyman
    >>> incomes.append(44000)   # Experienced journeyman
    >>> incomes.append(67000)   # Manager
    >>> incomes.append(9999999) # Bill Gates
    >>> median(incomes)
    38000.0
    >>> mean(incomes)
    1697499.8333333333

    The median here is somewhat close to the majority of incomes, while the
    mean is far from anybody's income.
    
    This implementation makes a temporary list of all numbers in memory.
     N/A s N/A list r N/A s_len N/A len s N/A N/A s_len 0 N/A N/A N/A ValueError can't calculate median of empty collection N/A N/A N/A s sort N/A center N/A s_len 2 N/A is_odd N/A s_len 2 N/A is_odd N/A N/A N/A s N/A center N/A low N/A s N/A N/A center 1 N/A high N/A s N/A center N/A N/A mean N/A low high N/A standard_deviation N/A N/A r sample N/A True N/A N/A Standard deviation. 
    
    `From the Python Cookbook
    <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442412>`_.
    Population mode contributed by Lorenzo Catucci.

    Standard deviation shows the variability within a sequence of numbers.
    A small standard deviation means the numbers are close to each other.  A
    large standard deviation shows they are widely different.  In fact it
    shows how far the numbers tend to deviate from the average.  This can be
    used to detect whether the average has been skewed by a few extremely high
    or extremely low values.

    Most natural and random phenomena follow the normal distribution (aka the
    bell curve), which says that most values are close to average but a few are
    extreme.  E.g., most people are close to 5'9" tall but a few are very tall
    or very short.  If the data does follow the bell curve, 68% of the values
    will be within 1 standard deviation (stdev) of the average, and 95% will be
    within 2 standard deviations.  So a university professor grading exams on a
    curve might give a "C" (mediocre) grade to students within 1 stdev of the
    average score, "B" (better than average) to those within 2 stdevs above,
    and "A" (perfect) to the 0.25% higher than 2 stdevs.  Those between 1 and 2
    stdevs below get a "D" (poor), and those below 2 stdevs... we won't talk
    about them.

    By default the helper computes the unbiased estimate
    for the population standard deviation, by applying an unbiasing
    factor of sqrt(N/(N-1)).

    If you'd rather have the function compute the population standard
    deviation, pass ``sample=False``.

    The following examples are taken from Wikipedia.
    http://en.wikipedia.org/wiki/Standard_deviation

        >>> standard_deviation([0, 0, 14, 14])
        8.082903768654761...
        >>> standard_deviation([0, 6, 8, 14])
        5.773502691896258...
        >>> standard_deviation([6, 6, 8, 8])
        1.1547005383792515
        >>> standard_deviation([0, 0, 14, 14], sample=False)
        7.0
        >>> standard_deviation([0, 6, 8, 14], sample=False)
        5.0
        >>> standard_deviation([6, 6, 8, 8], sample=False)
        1.0

    (The results reported in Wikipedia are those expected for whole
    population statistics and therefore are equal to the ones we get
    by setting ``sample=False`` in the later tests.)
    
    .. code-block:: pycon
    
        # Fictitious average monthly temperatures in Southern California.
        #                       Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
        >>> standard_deviation([70, 70, 70, 75, 80, 85, 90, 95, 90, 80, 75, 70])
        9.003366373785...
        >>> standard_deviation([70, 70, 70, 75, 80, 85, 90, 95, 90, 80, 75, 70], sample=False)
        8.620067027323...

        # Fictitious average monthly temperatures in Montana.
        #                       Jan  Feb  Mar Apr May Jun Jul  Aug Sep Oct Nov Dec
        >>> standard_deviation([-32, -10, 20, 30, 60, 90, 100, 80, 60, 30, 10, -32])
        45.1378360405574...
        >>> standard_deviation([-32, -10, 20, 30, 60, 90, 100, 80, 60, 30, 10, -32], sample=False) # doctest: +ELLIPSIS
        43.2161878106906...
     N/A avg N/A average r N/A sdsq N/A sum N/A N/A N/A i avg 2 N/A i r N/A sample N/A N/A normal_denom N/A N/A N/A len r 1 1 N/A N/A normal_denom N/A len r N/A N/A N/A sdsq normal_denom 0.5 N/A format_data_size N/A N/A size unit precision binary full_name N/A 1 False False N/A N/A Format a number using SI units (kilo, mega, etc.).

    ``size``: The number as a float or int.

    ``unit``: The unit name in plural form. Examples: "bytes", "B".

    ``precision``: How many digits to the right of the decimal point. Default
    is 1.  0 suppresses the decimal point.

    ``binary``: If false, use base-10 decimal prefixes (kilo = K = 1000).  
    If true, use base-2 binary prefixes (kibi = Ki = 1024).  

    ``full_name``: If false (default), use the prefix abbreviation ("k" or
    "Ki").  If true, use the full prefix ("kilo" or "kibi"). If false,
    use abbreviation ("k" or "Ki").

    Examples:

    >>> format_data_size(1024, "B")
    '1.0 kB'
    >>> format_data_size(1024, "B", 2)
    '1.02 kB'
    >>> format_data_size(1024, "B", 2, binary=True)
    '1.00 KiB'
    >>> format_data_size(54000, "Wh", 0)
    '54 kWh'
    >>> format_data_size(85000, "m/h", 0)
    '85 km/h'
    >>> format_data_size(85000, "m/h", 0).replace("km/h", "klicks")
    '85 klicks'
     N/A N/A full_name None N/A N/A full_name N/A N/A len unit 1 N/A N/A binary N/A N/A base 1000 N/A full_name N/A N/A multiples N/A kilo mega giga tera peta exa zetta yotta N/A N/A multiples N/A k M G T P E Z Y N/A N/A base 1024 N/A full_name N/A N/A multiples N/A kibi mebi gibi tebi pebi exbi zebi yobi N/A N/A multiples N/A Ki Mi Gi Ti Pi Ei Zi Yi N/A sign N/A N/A size 0 N/A N/A m N/A int N/A N/A math log size base N/A N/A N/A size 0 N/A N/A sign - N/A size N/A size N/A m N/A int N/A N/A math log size base N/A N/A m 0 N/A N/A m 8 N/A N/A m 8 N/A N/A m 0 N/A N/A precision %.0f N/A N/A precision N/A %%.%df precision N/A size N/A precision N/A size N/A N/A math pow base m N/A N/A %s%s %s%s N/A sign N/A N/A size strip N/A multiples N/A m unit N/A format_byte_size N/A N/A size precision binary full_name N/A 1 False False N/A N/A Same as ``format_data_size`` but specifically for bytes.
    
    Examples:

    >>> format_byte_size(2048)
    '2.0 kB'
    >>> format_byte_size(2048, full_name=True)
    '2.0 kilobytes'
     N/A full_name N/A N/A N/A format_data_size size bytes precision binary True N/A N/A N/A format_data_size size B precision binary False N/A format_bit_size N/A N/A size precision binary full_name N/A 1 False False N/A N/A Same as ``format_data_size`` but specifically for bits.

    Examples:

    >>> format_bit_size(2048)
    '2.0 kb'
    >>> format_bit_size(2048, full_name=True)
    '2.0 kilobits'
     N/A full_name N/A N/A N/A format_data_size size bits precision binary True N/A N/A N/A format_data_size size b precision binary False N/A