code: def apply_styles(self, cmdmap):
          
          is_list_like = lambda arg: isinstance(arg, (list, tuple))
          is_first_param_list = lambda c: c in ('COLBACKGROUNDS', 'ROWBACKGROUNDS')
          for cmd, args in cmdmap.iteritems():
              if not is_list_like(args):
                  args = [args]
              elif is_first_param_list(cmd) and is_list_like(args) and not is_list_like(args[0]):
                  args = [args]
              self.apply_style(cmd, *args)
          return self
docs: Apply the set of commands defined in cmdmap. for example, apply_styles({'FONTSIZE': 12, 'BACKGROUND': white})
          :param cmdmap: dict of commands mapped to the command arguments
          :return: self