MCPcopy Create free account
hub / github.com/Pometry/Raphtory / iterator_repr

Function iterator_repr

raphtory-api/src/python/repr.rs:18–25  ·  view source on GitHub ↗
(iter: I)

Source from the content-addressed store, hash-verified

16use std::{collections::HashMap, error::Error, ops::Deref, sync::Arc};
17
18pub fn iterator_repr<I: Iterator<Item = V>, V: Repr>(iter: I) -> String {
19 let values: Vec<String> = iter.take(11).map(|v| v.repr()).collect();
20 if values.len() < 11 {
21 values.join(", ")
22 } else {
23 values[0..10].join(", ") + ", ..."
24 }
25}
26
27pub fn iterator_dict_repr<I: Iterator<Item = (K, V)>, K: Repr, V: Repr>(iter: I) -> String {
28 let values: Vec<String> = iter

Callers 1

reprMethod · 0.85

Calls 5

collectMethod · 0.45
mapMethod · 0.45
takeMethod · 0.45
reprMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected