def _update_python_services(package_path):
    service_file_regexp = re.compile(r"(?:.*\s)?(.*?\.pyc)\b")

    manifest_path = os.path.join(package_path, "manifest.xml")
    tree = qisys.qixml.read(manifest_path)

    root = tree.getroot()
    services = root.findall("services/service")
    for service in services:
        exec_start = service.attrib["execStart"]
        exec_start = re.sub(r".py\b", r".pyc", exec_start)

        match_object = service_file_regexp.match(exec_start)
        if match_object == None:
            continue
        service_file_path = match_object.group(1)

        # update execStart command only if it points on a file inside the package
        if os.path.exists(os.path.join(package_path, service_file_path)):
            service.set("execStart", exec_start)

    qisys.qixml.write(tree, manifest_path, encoding="utf-8")
dataset/ETHPy150Open aldebaran/qibuild/python/qipkg/release.py/_update_python_services/operator `is` -> `==`