def _own_resource(pyk_client, resource_path, verbose):
    """
    Labels a resource with `guard=pyk` so that it can be
    selected with `?labelSelector=guard%3Dpyk`.
    """
    res = pyk_client.describe_resource(resource_path)
    resource = res.json()
    if resource["metadata"] in "labels":
        labels = resource["metadata"]["labels"]
    else:
        labels = {}
    labels["guard"] = "pyk"
    resource["metadata"]["labels"] = labels
    logging.debug("Owning resource, now labeled with: %s" %(resource["metadata"]["labels"]))
    pyk_client.execute_operation(method='PUT', ops_path=resource_path, payload=util.serialize_tojson(resource))
dataset/ETHPy150Open kubernauts/kploy/kploycommon.py/_own_resource/swapped operands of `in`