code: def example_graph_nx(
      feature_size=None,
      label="default",
      feature_name="feature",
      is_directed=False,
  ):
      graph = nx.DiGraph() if is_directed else nx.Graph()
      elist = [(1, 2), (2, 3), (1, 4), (4, 2)]
      graph.add_nodes_from([1, 2, 3, 4], label=label)
      graph.add_edges_from(elist, label=label)
  
      # Add example features
      if feature_size is not None:
          for v in graph.nodes():
              graph.nodes[v][feature_name] = int(v) * np.ones(
                  feature_size
              )
  
      return graph
  
imports: from stellargraph import StellarGraph, StellarDiGraph, IndexedArray
  import networkx
  import pandas
  import numpy
  import random
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: example_graph_nx(feature_size, label, feature_name, is_directed) and returns: graph