def validate_metapackage(path, package):
    # Is there actually a package at the given path, else raise
    # Cannot do package_exists_at from catkin_pkg.packages because of circular dep
    if not os.path.isdir(path) or not os.path.isfile(os.path.join(path, 'package.xml')):
        raise OSError("No package.xml found at path: '%s'" % path)
    # Is it a metapackage, else raise
    if not package.is_metapackage():
        raise InvalidMetapackage('No <metapackage/> tag in <export> section of package.xml', path, package)
    # Is there a CMakeLists.txt, else raise
    if not has_cmakelists_txt(path):
        raise InvalidMetapackage('No CMakeLists.txt', path, package)
    # Is the CMakeLists.txt correct, else raise
    if not has_valid_cmakelists_txt(path, package.name):
        raise InvalidMetapackage("""\
Invalid CMakeLists.txt
Expected:
<<<%s>>>
Got:
<<<%s>>>""" % (get_cmakelists_txt(path), get_expected_cmakelists_txt(package.name)), path, package
        )
    # Does it buildtool depend on catkin, else raise
    if not package.has_buildtool_depend_on_catkin():
        raise InvalidMetapackage("No buildtool dependency on catkin", path, package)
    # Does it have only run depends, else raise
    if package.has_invalid_metapackage_dependencies():
        raise InvalidMetapackage(
            "Has build, buildtool, and/or test depends, but only run depends are allowed (except buildtool catkin)",
            path, package)
x.__cmp__(y) <==> cmp(x,y)
dataset/ETHPy150Open ros-infrastructure/catkin_pkg/src/catkin_pkg/metapackage.py/validate_metapackage--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/OpenMayaAnim.py/new_instancemethod.__cmp__