exbi = pebi * 1024
# memory size configuration stuff
-def to_integer(value):
+def toInteger(value):
if not isinstance(value, str):
result = int(value)
elif value.endswith('Ei'):
return result
-def to_bool(val):
+def toBool(val):
t = type(val)
if t == bool:
return val
elif val == "false" or val == "f" or val == "no" or val == "n":
return False
- return to_integer(val) != 0
+ return toInteger(val) != 0
-def to_frequency(value):
+def toFrequency(value):
if not isinstance(value, str):
result = float(value)
elif value.endswith('THz'):
return result
-def to_latency(value):
+def toLatency(value):
if not isinstance(value, str):
result = float(value)
elif value.endswith('c'):
return result;
-def to_network_bandwidth(value):
+def toNetworkBandwidth(value):
if not isinstance(value, str):
result = float(value)
elif value.endswith('Tbps'):
return result
-def to_memory_bandwidth(value):
+def toMemoryBandwidth(value):
if not isinstance(value, str):
result = int(value)
elif value.endswith('PB/s'):
return result
-def to_memory_size(value):
+def toMemorySize(value):
if not isinstance(value, str):
result = int(value)
elif value.endswith('PB'):
class Proxy(str):
def __int__(self):
- return int(to_integer(str(self)))
+ return int(toInteger(str(self)))
def __long__(self):
- return long(to_integer(str(self)))
+ return long(toInteger(str(self)))
def __float__(self):
- return float(to_integer(str(self)))
+ return float(toInteger(str(self)))
def __nonzero__(self):
- return to_bool(str(self))
+ return toBool(str(self))
def convert(self, other):
t = type(other)
if t == bool: