MCPcopy Create free account
hub / github.com/Tencent/digitalhuman / printf

Function printf

SWF/src/utils.py:12–26  ·  view source on GitHub ↗
(*texts)

Source from the content-addressed store, hash-verified

10import numpy as np
11
12def printf(*texts):
13 if os.environ.get('DEBUG', 'True') == 'False':
14 return
15 if texts[0].startswith('TASK>'):
16 format = "\033[1;34m{text}\033[0m"
17 elif texts[0].startswith("AGENT>"):
18 format = "\033[32m{text}\033[0m"
19 elif texts[0].startswith('ROUND>') or texts[0].startswith('==='):
20 format = "\033[1;33m{text}\033[0m"
21 elif texts[0].startswith('ERROR>') or texts[0].startswith('ANSWER>') or texts[0].startswith('ENV>'):
22 format = "\033[1;31m{text}\033[0m"
23 else:
24 format = "\033[1;37m{text}\033[0m"
25 for text in texts:
26 print(format.format(text=text))
27
28
29def load_data(filename, file_type=None):

Callers 15

stepMethod · 0.90
baseline.pyFile · 0.90
runMethod · 0.90
_task_assignMethod · 0.90
_task_assignMethod · 0.90
utils.pyFile · 0.85
number_comparison_holdsFunction · 0.85
transform_to_LNFFunction · 0.85
is_linear_taskFunction · 0.85
is_linear_expressionFunction · 0.85
print_lnf_representationFunction · 0.85
normalize_expressionsFunction · 0.85

Calls 3

printFunction · 0.85
getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected