<｜begin▁of▁sentence｜>### Instruction:
Imagine, as a creative packaging designer, you're tasked with conceptualizing a unique box structure to hold a set of four novelty items. The creative challenge is to produce a design where one item is easily accessible with no direct connections (akin to an in-degree of 0), two items should link to exactly one other item (reflecting in-degrees of 1), and one final item is to be connected to two others (mirroring an in-degree of 2). Simultaneously, each item must display a single point of connection leading out to another (out-degrees of 1 for all items).

Taking the design challenge further, you're to integrate a specific interaction pattern detailed on a creative brief, symbolized by the joint degree dictionary {1: {1: 2, 2: 2}}. This blueprint represents a balance of connections among items you want to manifest: connections between items following a one-to-one and one-to-two ratio must be equally represented.

Your goal is to draft a template for a packaging system that embodies these relationships. How would you craft a prototype of this engaging package that creatively upholds the specified linkage instructions of accessibility and interaction among the items while respecting the visual aesthetics and functionality of the design?
### Response:
import networkx as nx

in_degrees = [0, 1, 1, 2]
out_degrees = [1, 1, 1, 1]
nkk = {1: {1: 2, 2: 2}}
seed = 42  # Optional seed for reproducibility

# Generate a random directed graph with the joint degree
G = nx.directed_joint_degree_graph(in_degrees, out_degrees, nkk, seed=seed)

# Extracting nodes and edges for JSON
nodes = [{'id': node, 'label': f'Node {node}'} for node in G.nodes()]
edges = [{'source': edge[0], 'target': edge[1], 'label': f'Edge from {edge[0]} to {edge[1]}'} for edge in G.edges()]

graph_json = {'graph_nodes': nodes, 'graph_edges': edges}
print(graph_json)
<|EOT|>
