<｜begin▁of▁sentence｜>### Instruction:
Given an undirected graph with weighted edges where weights are real numbers, can you use the 'is_real_weighted' function from graspologic to verify that all edges in the network have a real number as their weight?
### Response:
import networkx as nx
from graspologic.preconditions import is_real_weighted

G = nx.Graph()
G.add_edge(1, 2, weight=3.5)
G.add_edge(2, 3, weight=2.1)
G.add_edge(1, 3, weight=-4.0)  # Negative weights are allowed as long as they are real numbers

# Check if all edges have a real number as the weight attribute
canonical = is_real_weighted(G, weight_attribute='weight')
print(canonical)
<|EOT|>
