'checks so the cmdsethandler contains a given cmdset
Args:
cmdset (str or Cmdset): Cmdset key, pythonpath or
Cmdset to check the existence for.
must_be_default (bool, optional): Only return True if
the checked cmdset is the default one.
Returns:
has_cmdset (bool): Whether or not the cmdset is in the handler.'

def has(self, cmdset, must_be_default=False):

    if (callable(cmdset) and hasattr(cmdset, 'path')):
        print 'Try    callable', cmdset
        if must_be_default:
            return (self.cmdset_stack and (self.cmdset_stack[0].path == cmdset.path))
        else:
            print [cset.path for cset in self.cmdset_stack], cmdset.path
            return any([cset for cset in self.cmdset_stack if (cset.path == cmdset.path)])
    elif must_be_default:
        return (self.cmdset_stack and ((self.cmdset_stack[0].key == cmdset) or (self.cmdset_stack[0].path == cmdset)))
    else:
        return any([cset for cset in self.cmdset_stack if ((cset.path == cmdset) or (cset.key == cmdset))])
