def _destroy(pyk_client, namespace, here, dir_name, alist, resource_name, verbose):
    """
    Destroys resources based on manifest files. Currently the following resources are supported:
    replication controllers, services.
    """
    for litem in alist:
        file_name = os.path.join(os.path.join(here, dir_name), litem)
        if file_name.endswith(".url"):
            file_name = _deref_remote(file_name)
        if verbose: logging.info("Trying to destroy %s %s" %(resource_name, file_name))
        res_manifest, _  = util.load_yaml(filename=file_name)
        res_name = res_manifest["metadata"]["name"]
        if resource_name == "service":
            res_path = "".join(["/api/v1/namespaces/", namespace, "/services/", res_name])
        elif resource_name == "RC":
            res_path = "".join(["/api/v1/namespaces/", namespace, "/replicationcontrollers/", res_name])
            res = pyk_client.describe_resource(res_path)
            if res.status_code == 404:  # the replication controller is already gone
                break                   # ... don't try to scale down
            else:
                resource = res.json()
                resource["spec"]["replicas"] = 0
                if verbose: logging.info((res_path) %"Scaling down RC %s to 0")
                pyk_client.execute_operation(method='PUT', ops_path=res_path, payload=util.serialize_tojson(resource))
        else: return None
        pyk_client.delete_resource(resource_path=res_path)
dataset/ETHPy150Open kubernauts/kploy/kploycommon.py/_destroy/swapped operands of `%`