/usr/share/pyshared/pandas/stats/common.py is in python-pandas 0.7.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | def _get_cluster_type(cluster_type):
cluster_type = _WINDOW_TYPES.get(cluster_type, cluster_type)
if cluster_type is None:
return cluster_type
cluster_type_up = cluster_type.upper()
if cluster_type_up == 'ENTITY':
return 'entity'
elif cluster_type_up == 'TIME':
return 'time'
else: # pragma: no cover
raise Exception('Unrecognized cluster type: %s' % cluster_type)
_CLUSTER_TYPES = {
0 : 'time',
1 : 'entity'
}
_WINDOW_TYPES = {
0 : 'full_sample',
1 : 'rolling',
2 : 'expanding'
}
def _get_window_type(window_type):
window_type = _WINDOW_TYPES.get(window_type, window_type)
window_type_up = window_type.upper()
if window_type_up in ('FULL SAMPLE', 'FULL_SAMPLE'):
return 'full_sample'
elif window_type_up == 'ROLLING':
return 'rolling'
elif window_type_up == 'EXPANDING':
return 'expanding'
else: # pragma: no cover
raise Exception('Unrecognized window type: %s' % window_type)
def banner(text, width=80):
"""
"""
toFill = width - len(text)
left = toFill // 2
right = toFill - left
return '%s%s%s' % ('-' * left, text, '-' * right)
|