<｜begin▁of▁sentence｜>### Instruction:
A developer wants to ensure that a function they are writing which analyzes the connectivity of a network only receives a NetworkX graph as its argument. How can they use Graspologic's `check_argument_types` to enforce this requirement while writing their function?
### Response:
import networkx as nx
from graspologic.preconditions import check_argument_types

# Function that uses graspologic's check_argument_types

def receive_graph(graph):
    # Use check_argument_types to ensure the argument is a correct type
    check_argument_types(graph, nx.Graph, "'graph' argument must be a networkx.Graph instance.")
    # Now handle the graph knowing it's the correct type
    print('Graph has', graph.number_of_nodes(), 'nodes and', graph.number_of_edges(), 'edges.')


# Creating a simple graph using NetworkX
G = nx.Graph()
G.add_nodes_from([1, 2, 3])
G.add_edge(1, 2)

# Call the function with the graph
receive_graph(G)
<|EOT|>
