code: def ansi_code(name):
      
      try:
          obj = colorama
          for part in name.split("."):
              obj = getattr(obj, part)
          return obj
      except AttributeError:
          return ""
docs: Return ansi color or style codes or '' if colorama is not available.