Server IP : 172.24.0.40 / Your IP : 216.73.216.10 Web Server : Apache System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64 User : apache ( 48) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/python3.6/site-packages/vdo/statistics/__pycache__/ |
Upload File : |
3 &gnd" � @ sX d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd� de�ZG dd � d e�Zd S )z� LabeledValue - A sampled statistic with a label. Used for formatting stats output. $Id: //eng/vdo-releases/aluminum/src/python/vdo/statistics/LabeledValue.py#2 $ � )�absolute_import)�division)�print_function)�unicode_literalsc @ sN e Zd ZdZedd� �Zdd� Zdd� Zdd � Zd d� Z dd � Z ddd�ZdS )�LabeledValuezl An object which represents a labeled statistic value or a labeled collection of other LabeledValues. c C s t |t�rt| |�S t| |�S )a Create a new labeled value. :param label: The label :param value: The value :return: The new labeled value. If the supplied value is a list, the returned object will be a LabeledValueList, otherwise it will be a LabeledValue. )� isinstance�list�LabeledValueListr )�label�value� r �"/usr/lib/python3.6/LabeledValue.py�make% s zLabeledValue.makec C s || _ || _dS )z^ Create a new labeled value. :param label: The label :param value: The value N)r r )�selfr r r r r �__init__5 s zLabeledValue.__init__c C s dS )zt Check whether this is a collection or a single value. :return: True if this is a collection of values Fr )r r r r � isMultiValued? s zLabeledValue.isMultiValuedc C s t | j�S )zY Get the width of the label for this value. :return: The width of the label )�lenr )r r r r �widthG s zLabeledValue.widthc C s | j � S )aX Get the maximum width of the labels of this value and/or all of its sub-values. :param hierarchical: Whether the format mode is hierarchical or not :return: The width of this value or its immediate sub-values if hierarchical, otherwise, the width of this value or its full tree of sub-values. )r )r �hierarchicalr r r �subWidthO s zLabeledValue.subWidthc C s dS )z� Check whether this value has a subvalue for the given index. :param index: The index into the subvalue list to check :return: True if the indexed subvalue exists Fr )r �indexr r r �hasSubValue\ s zLabeledValue.hasSubValueNc C s"