def menu(*args, **kwargs):
    """
Modifications
  - added ability to query parent
    """
    if _versions.v2011 < _versions.current():
        # on create only
        if not ( kwargs.get('query', False) or kwargs.get('q', False) ) \
            and not ( kwargs.get('edit', False) or kwargs.get('e', False) ) \
            and not ( kwargs.get('parent', False) or kwargs.get('p', False) ):
            kwargs['parent'] = cmds.setParent(q=1)

    if ( kwargs.get('query', False) or kwargs.get('q', False) ) \
            and ( kwargs.get('parent', False) or kwargs.get('p', False) ):
        name = unicode(args[0])
        if '|' not in name:
            try:
                name = _findLongName(name, 'menu')
            except ValueError:
                name = _findLongName(name, 'popupMenu')
        return name.rsplit('|',1)[0]

    result = cmds.menu(*args, **kwargs)

    if ( kwargs.get('query', False) or kwargs.get('q', False) ) \
            and ( kwargs.get('itemArray', False) or kwargs.get('ia', False) ) \
            and result is None:
        result = []
    return result
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/core/windows.py/menu/swapped operands of `<`