m = 10000 # max value with prov.desc("L1 - assign", line=1) as line: e_n10000 = prov.entity("10000", "10000", prov.SCRIPT + "literal", None, line, attrs=HIDE) e_m = prov.entity("m", "10000", prov.SCRIPT + "name", "m", line, attrs=HIDE) prov.activity("assign", [(e_m, e_n10000)], attrs=HIDE) # Line 2 result = dist = [[0, 1, 4], [m, 0, 2], [2, m, 0]] with prov.desc("L2 - list definition / assign", line=2) as line: with prov.desc("L2 - list definition"): e_n0 = prov.entity("0", "0", prov.SCRIPT + "literal", None, line + 1, attrs=HIDE) e_n1 = prov.entity("1", "1", prov.SCRIPT + "literal",
attrs=dict(**{prov.NAMESPACE + "checkpoint": checkpoint}, **extra)) # Line 1 m = 10000 # max value with prov.desc("L1 - assign", line=1) as line: e_n10000 = prov.entity("10000", "10000", prov.SCRIPT + "literal", None, line, attrs=HIDE) e_m = prov.entity("m", "10000", prov.SCRIPT + "name", "m", line) prov.activity("assign", [prov.RefDerivation(time(), e_m, e_n10000, attrs=HIDE)], attrs=HIDE) # Line 2 result = dist = [[0, 1, 4], [m, 0, 2], [2, m, 0]] with prov.desc("L2 - list definition / assign", line=2) as line: with prov.desc("L2 - list definition"): e_n0 = prov.entity("0", "0", prov.SCRIPT + "literal", None, line + 1) e_n1 = prov.entity("1", "1", prov.SCRIPT + "literal", None, line + 1) e_n4 = prov.entity("4", "4", prov.SCRIPT + "literal", None, line + 1) e_n2 = prov.entity("2", "2", prov.SCRIPT + "literal", None, line + 2) prov_dist = [[e_n0, e_n1, e_n4], [e_m, e_n0, e_n2], [e_n2, e_m, e_n0]] prov_label = [["0", "1", "4"], ["m", "0", "2"], ["2", "m", "0"]] ti = time()
# Line 1 m = 10000 # max value with prov.desc("L1 - assign", line=1) as line: e_n10000 = prov.entity("10000", None, prov.SCRIPT + "literal", "10000", line, attrs=HIDE) v_10000 = prov.value("v10000", "10000", attrs=SPECIFIC) prov.defined(e_n10000, v_10000, time(), attrs=SPECIFIC) e_m = prov.entity("m", None, prov.SCRIPT + "name", "m", line, attrs=HIDE) prov.activity("assign", [(e_m, e_n10000)], attrs=HIDE) prov.accessed(e_m, v_10000, time(), attrs=SPECIFIC) # Line 2 result = dist = [[0, 1, 4], [m, 0, 2], [2, m, 0]] with prov.desc("L2 - list definition / assign", line=2) as line: with prov.desc("L2 - list definition"): e_n0 = prov.entity("0", None, prov.SCRIPT + "literal", "0", line + 1, attrs=HIDE) v_0 = prov.value("v0", "0", attrs=SPECIFIC) prov.defined(e_n0, v_0, time(), attrs=SPECIFIC)