code: def ansi_cmd(cmd, *args):
      
      try:
          obj = getattr(ANSI, str('cmd_{}'.format(cmd)))
      except AttributeError:
          raise ValueError(
              "incorrect command: {!r}".format(cmd))
      if isinstance(obj, type("")):
          return obj
      else:
          return obj(*args)
docs: Get ANSI command code by name.