def is_weighted(G, edge=None, weight='weight'):
    if edge is not None:
        data = G.get_edge_data(*edge)
        if data is None:
            msg = 'Edge {!r} does not exist.'.format(edge)
            raise nx.NetworkXError(msg)
        return weight in data

    if is_empty(G):
        # Special handling required since: all([]) == True
        return False

    return all(weight in data for u, v, data in G.edges(data=True))
Ensure those Debian/Ubuntu packages are installed
dataset/ETHPy150Open networkx/networkx/networkx/classes/function.py/is_weighted--crossover with--dataset/ETHPy150Open DNX/django-fagungis/fagungis/tasks.py/_install_dependencies