def METHOD_NAME(dataload_name, dataset_name, namespace):
    api = client.CustomObjectsApi()
    for i in range(0, 60):
        dataload = api.get_namespaced_custom_object(
            group="data.fluid.io",
            version="v1alpha1",
            name=dataload_name,
            namespace=namespace,
            plural="dataloads"
        )
        dataset = api.get_namespaced_custom_object(
            group="data.fluid.io",
            version="v1alpha1",
            name=dataset_name,
            namespace=namespace,
            plural="datasets"
        )
        dataload_status = dataload["status"]["phase"]
        opRef = dataset["status"].get("operationRef", {})
        if dataload_status == "Failed":
            print("Dataload {} is failed".format(dataload_name))
            return False
        elif dataload_status == "Complete":
            if opRef is not None and opRef.get("DataLoad", "") != "":
                print("DataLoad {} is complete but dataset opRef {} is not None".format(dataload_name, opRef))
                return False
        elif dataload_status == "Executing":
            if opRef is None:
                print("Dataload {} is running but dataset opRef None".format(dataload_name))
                return False
            if opRef.get("DataLoad", "") != dataload_name:
                print("DataLoad {} is running but dataset opRef {}".format(dataload_name, opRef))
                return False
        time.sleep(1)
    return True