INNER CODE UNIT · Python

print_colored_status

DmitryRyumin/ICCV-2023-25-Papers · code/markdown_to_json_parser.py:39

def print_colored_status(status):
    color_codes = {"No table": 91, "Success": 92, "Error": 91}
    color_code = color_codes.get(status, 0)  # Default to red color if not found
    return f"\033[{color_code}m{status}\033[0m" if color_code else status


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):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…