code: def test_convert_edges_weights():
      def run(ws):
          dfs = {
              name: pd.DataFrame(
                  {"s": [0], "t": [1], "w": [w]}, index=[i]
              )
              for i, (name, w) in enumerate(ws.items())
          }
          nodes = convert_nodes(
              pd.DataFrame([], index=[0, 1]),
              name="other_name",
              default_type=np.int8,
              dtype=np.int8,
          )
  
          convert_edges(
              dfs,
              name="some_name",
              default_type="d",
              source_column="s",
              target_column="t",
              weight_column="w",
              nodes=nodes,
              type_column=None,
              dtype=np.int8,
          )
  
      # various numbers are valid
      run({"x": np.int8(1)})
      run({"x": np.complex64(1)})
      run(
          {
              "x": np.complex128(1),
              "y": np.uint16(2),
              "z": np.float32(3.0),
          }
      )
      # non-numbers are not
      with pytest.raises(
          TypeError,
          match=r"some_name: expected weight column 'w' to be numeric, found dtype 'object'",
      ):
          run({"x": "ab", "y": 1, "z": np.float32(2)})
  
imports: import networkx
  import numpy
  import pandas
  import pytest
  from stellargraph.core.convert import ColumnarConverter, convert_nodes, convert_edges, from_networkx
  from stellargraph.core.indexed_array import IndexedArray
label_desc: Use image node_id 15 for calling a global function with example usage: test_convert_edges_weights() without return types