<｜begin▁of▁sentence｜>### Instruction:
If I would like to create a random unlabeled forest with 10 nodes, where each tree has no more than 3 nodes and I want this forest to be generated once and not as a list of forests, how would I do that using NetworkX?
### Response:
import networkx as nx

# Using the random_unlabeled_rooted_forest function to generate a forest
forest = nx.random_trees.random_unlabeled_rooted_forest(n=10, q=3, number_of_forests=None, seed=None)

# Print the nodes and edges of the generated forest
print('Nodes:', forest.nodes())
print('Edges:', forest.edges())

# Retrieve and print the roots of the forest from the graph attribute
roots = forest.graph['roots']
print('Roots:', roots)
<|EOT|>
