code: def test_custom_attrs_dep(self):
      G = nx.path_graph(4)
      G.add_node(1, color="red")
      G.add_edge(1, 2, width=7)
      G.graph[1] = "one"
      G.graph["foo"] = "bar"
  
      attrs = {
          "source": "c_source",
          "target": "c_target",
          "name": "c_id",
          "key": "c_key",
          "link": "c_links",
      }
  
      H = node_link_graph(
          node_link_data(G, **attrs), multigraph=False, **attrs
      )
      assert nx.is_isomorphic(G, H)
      assert H.graph["foo"] == "bar"
      assert H.nodes[1]["color"] == "red"
      assert H[1][2]["width"] == 7
  
      # provide only a partial dictionary of keywords.
      # This is similar to an example in the doc string
      attrs = {
          "link": "c_links",
          "source": "c_source",
          "target": "c_target",
      }
      H = node_link_graph(
          node_link_data(G, **attrs), multigraph=False, **attrs
      )
      assert nx.is_isomorphic(G, H)
      assert H.graph["foo"] == "bar"
      assert H.nodes[1]["color"] == "red"
      assert H[1][2]["width"] == 7
  
file_path: networkx/networkx/readwrite/json_graph/tests/test_node_link.py
imports: import json
  import pytest
  import networkx
  from networkx.readwrite.json_graph import node_link_data, node_link_graph
label_desc: Use image node_id 1 for calling the TestNodeLink obj's underlying member method code with example usage: obj.test_custom_attrs_dep() without return types