MCPcopy
hub / github.com/ray-project/ray / named_values

Function named_values

python/ray/data/tests/util.py:72–80  ·  view source on GitHub ↗
(col_names, tuples)

Source from the content-addressed store, hash-verified

70# Ex: named_values("id", [1, 2, 3])
71# Ex: named_values(["id", "id2"], [(1, 1), (2, 2), (3, 3)])
72def named_values(col_names, tuples):
73 output = []
74 if isinstance(col_names, list):
75 for t in tuples:
76 output.append(dict(zip(col_names, t)))
77 else:
78 for t in tuples:
79 output.append({col_names: t})
80 return output
81
82
83def extract_values(col_name, tuples):

Calls 1

appendMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…