INNER CODE UNIT · Python
print_colored_count
DmitryRyumin/ICCV-2023-25-Papers · code/markdown_to_json_parser.py:45
def print_colored_count(count, label):
color_code = 91 # Default to red color for No table and Errors
if label == "Success" and count > 0:
color_code = 92 # Green color for Success
elif label in ["No table", "Errors"] and count == 0:
color_code = 92 # Green color for No table or Errors when count is 0
return f"\033[{color_code}m{count}\033[0m"
def is_digits(string):
pattern = r"^\d+$"
return bool(re.match(pattern, string)) if string else False
def clear_directory(directory):