parameters: (requestContext, seriesList, system=None, units=None)
return_statement: return seriesList
docstring: Takes a series list and modifies the aliases to provide column aligned
    output with Current, Max, and Min values in the style of cacti. Optionally
    takes a "system" value to apply unit formatting in the same style as the
    Y-axis, or a "unit" string to append an arbitrary unit suffix.
  
    .. code-block:: none
  
      &target=cactiStyle(ganglia.*.net.bytes_out,"si")
      &target=cactiStyle(ganglia.*.net.bytes_out,"si","b")
  
    A possible value for ``system`` is ``si``, which would express your values in
    multiples of a thousand. A second option is to use ``binary`` which will
    instead express your values in multiples of 1024 (useful for network devices).
  
    Column alignment of the Current, Max, Min values works under two conditions:
    you use a monospace font such as terminus and use a single cactiStyle call, as
    separate cactiStyle calls are not aware of each other. In case you have
    different targets for which you would like to have cactiStyle to line up, you
    can use ``group()`` to combine them before applying cactiStyle, such as:
  
    .. code-block:: none
  
      &target=cactiStyle(group(metricA,metricB))
docstring_summary: Takes a series list and modifies the aliases to provide column aligned
    output with Current, Max, and Min values in the style of cacti. Optionally
    takes a "system" value to apply unit formatting in the same style as the
    Y-axis, or a "unit" string to append an arbitrary unit suffix.
docstring_tokens: Takes a series list and modifies the aliases to provide column aligned output with Current Max and Min values in the style of cacti . Optionally takes a system value to apply unit formatting in the same style as the Y - axis or a unit string to append an arbitrary unit suffix .
function: def cactiStyle(requestContext, seriesList, system=None, units=None):
    """
    Takes a series list and modifies the aliases to provide column aligned
    output with Current, Max, and Min values in the style of cacti. Optionally
    takes a "system" value to apply unit formatting in the same style as the
    Y-axis, or a "unit" string to append an arbitrary unit suffix.
  
    .. code-block:: none
  
      &target=cactiStyle(ganglia.*.net.bytes_out,"si")
      &target=cactiStyle(ganglia.*.net.bytes_out,"si","b")
  
    A possible value for ``system`` is ``si``, which would express your values in
    multiples of a thousand. A second option is to use ``binary`` which will
    instead express your values in multiples of 1024 (useful for network devices).
  
    Column alignment of the Current, Max, Min values works under two conditions:
    you use a monospace font such as terminus and use a single cactiStyle call, as
    separate cactiStyle calls are not aware of each other. In case you have
    different targets for which you would like to have cactiStyle to line up, you
    can use ``group()`` to combine them before applying cactiStyle, such as:
  
    .. code-block:: none
  
      &target=cactiStyle(group(metricA,metricB))
  
    """
    if 0 == len(seriesList):
        return seriesList
    if system:
        if units:
            fmt = lambda x:"%.2f %s" % format_units(x,system=system,units=units)
        else:
            fmt = lambda x:"%.2f%s" % format_units(x,system=system)
    else:
        if units:
            fmt = lambda x: "%.2f %s" % (x, units)
        else:
            fmt = lambda x: "%.2f" % x
  
    nameLen = max([0] + [len(getattr(series,"name")) for series in seriesList])
    lastLen = max([0] + [len(fmt(int(safe.safeLast(series) or 3))) for series in seriesList]) + 3
    maxLen = max([0] + [len(fmt(int(safe.safeMax(series) or 3))) for series in seriesList]) + 3
    minLen = max([0] + [len(fmt(int(safe.safeMin(series) or 3))) for series in seriesList]) + 3
    for series in seriesList:
        last = safe.safeLast(series)
        maximum = safe.safeMax(series)
        minimum = safe.safeMin(series)
        if last is None:
          last = NAN
        else:
          last = fmt(float(last))
  
        if maximum is None:
          maximum = NAN
        else:
          maximum = fmt(float(maximum))
        if minimum is None:
          minimum = NAN
        else:
          minimum = fmt(float(minimum))
  
        series.name = "%*s Current:%*s Max:%*s Min:%*s " % \
            (-nameLen, series.name,
             -lastLen, last,
             -maxLen, maximum,
             -minLen, minimum)
    return seriesList
function_tokens: def cactiStyle ( requestContext , seriesList , system = None , units = None ) : if 0 == len ( seriesList ) : return seriesList if system : if units : fmt = lambda x : "%.2f %s" % format_units ( x , system = system , units = units ) else : fmt = lambda x : "%.2f%s" % format_units ( x , system = system ) else : if units : fmt = lambda x : "%.2f %s" % ( x , units ) else : fmt = lambda x : "%.2f" % x nameLen = max ( [ 0 ] + [ len ( getattr ( series , "name" ) ) for series in seriesList ] ) lastLen = max ( [ 0 ] + [ len ( fmt ( int ( safe . safeLast ( series ) or 3 ) ) ) for series in seriesList ] ) + 3 maxLen = max ( [ 0 ] + [ len ( fmt ( int ( safe . safeMax ( series ) or 3 ) ) ) for series in seriesList ] ) + 3 minLen = max ( [ 0 ] + [ len ( fmt ( int ( safe . safeMin ( series ) or 3 ) ) ) for series in seriesList ] ) + 3 for series in seriesList : last = safe . safeLast ( series ) maximum = safe . safeMax ( series ) minimum = safe . safeMin ( series ) if last is None : last = NAN else : last = fmt ( float ( last ) ) if maximum is None : maximum = NAN else : maximum = fmt ( float ( maximum ) ) if minimum is None : minimum = NAN else : minimum = fmt ( float ( minimum ) ) series . name = "%*s Current:%*s Max:%*s Min:%*s " % ( - nameLen , series . name , - lastLen , last , - maxLen , maximum , - minLen , minimum ) return seriesList