code: def test_from_networkx_with_bad_attributes(nx) -> None:
      G = nx.Graph()
      G.add_nodes_from(
          [
              (0, {"index": "a", "attr_1": 10}),
              (1, {"index": "b", "attr_1": 20}),
          ]
      )
      G.add_edges_from([[0, 1]])
  
      with pytest.warns(UserWarning):
          renderer = bpg.from_networkx(G, nx.circular_layout)
          assert renderer.node_renderer.data_source.data["index"] == [
              0,
              1,
          ]
          assert renderer.node_renderer.data_source.data["attr_1"] == [
              10,
              20,
          ]
  
      G = nx.Graph()
      G.add_nodes_from([0, 1])
      G.add_edges_from([(0, 1, {"start": "A", "attr_1": 10})])
  
      with pytest.warns(UserWarning):
          renderer = bpg.from_networkx(G, nx.circular_layout)
          assert renderer.edge_renderer.data_source.data["start"] == [0]
          assert renderer.edge_renderer.data_source.data["end"] == [1]
          assert renderer.edge_renderer.data_source.data["attr_1"] == [
              10
          ]
  
      G = nx.Graph()
      G.add_nodes_from([0, 1])
      G.add_edges_from([(0, 1, {"end": "A", "attr_1": 10})])
  
      with pytest.warns(UserWarning):
          renderer = bpg.from_networkx(G, nx.circular_layout)
          assert renderer.edge_renderer.data_source.data["start"] == [0]
          assert renderer.edge_renderer.data_source.data["end"] == [1]
          assert renderer.edge_renderer.data_source.data["attr_1"] == [
              10
          ]
  
file_path: bokeh/tests/unit/bokeh/plotting/test_graph.py
imports: from __future__ import annotations
  import pytest
  import numpy
  from numpy.testing import assert_allclose
  import bokeh.plotting.graph
label_desc: Use image node_id 6 for calling a global function with example usage: test_from_networkx_with_bad_attributes(nx) without return types