MCPcopy Create free account
hub / github.com/alibaba/GraphScope / process_sub_label

Function process_sub_label

python/graphscope/framework/graph_utils.py:359–377  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

357 """
358
359 def process_sub_label(items):
360 if isinstance(items, (Loader, str, pd.DataFrame, *VineyardObjectTypes)):
361 return EdgeSubLabel(
362 items, None, "_", "_", 0, 1, id_type=id_type, eformat=eformat
363 )
364 elif isinstance(items, Sequence):
365 if all([isinstance(item, np.ndarray) for item in items]):
366 return EdgeSubLabel(
367 items, None, "_", "_", 0, 1, id_type=id_type, eformat=eformat
368 )
369 else:
370 check_argument(len(items) < 6, "Too many arguments for a edge label")
371 compat_items = _convert_array_to_deprecated_form(items)
372 return EdgeSubLabel(*compat_items, id_type=id_type, eformat=eformat)
373 elif isinstance(items, Mapping):
374 items = _convert_dict_to_compat_form(items)
375 return EdgeSubLabel(**items, id_type=id_type, eformat=eformat)
376 else:
377 raise SyntaxError("Wrong format of e sub label: " + str(items))
378
379 def process_label(label, items):
380 e_label = EdgeLabel(label, id_type)

Callers 1

process_labelFunction · 0.85

Calls 4

check_argumentFunction · 0.90
EdgeSubLabelClass · 0.85

Tested by

no test coverage detected