I was never a fan of using globals, so, how about you use the import termcolor in the try/exception block at the beginning and then, down in the ```colored``` method you can also use a try/exception block where you first try to use ```termcolor.colored``` and catch the exception for it, returning ```text```?