code: def test_hammer_bundle_with_weights(
      nodes, weighted_edges, include_edge_id
  ):
      # Expect four lines starting at center (0.0, 0.0) and terminating
      # with NaN
      data = pd.DataFrame(
          {
              "edge_id": [
                  1.0,
                  np.nan,
                  2.0,
                  np.nan,
                  3.0,
                  np.nan,
                  4.0,
                  np.nan,
              ],
              "x": [0.0, np.nan, 0.0, np.nan, 0.0, np.nan, 0.0, np.nan],
              "y": [0.0, np.nan, 0.0, np.nan, 0.0, np.nan, 0.0, np.nan],
              "weight": [
                  1.0,
                  np.nan,
                  1.0,
                  np.nan,
                  1.0,
                  np.nan,
                  1.0,
                  np.nan,
              ],
          }
      )
      columns = (
          ["edge_id", "x", "y", "weight"]
          if include_edge_id
          else ["x", "y", "weight"]
      )
      expected = pd.DataFrame(data, columns=columns)
  
      df = hammer_bundle(
          nodes, weighted_edges, include_edge_id=include_edge_id
      )
  
      starts = df[(df.x == 0.0) & (df.y == 0.0)]
      ends = df[df.isnull().any(axis=1)]
      given = pd.concat([starts, ends])
      given.sort_index(inplace=True)
      given.reset_index(drop=True, inplace=True)
  
      assert given.equals(expected)
  
file_path: datashader/datashader/tests/test_bundling.py
imports: from __future__ import annotations
  import pytest
  import numpy
  import pandas
  from datashader.bundling import directly_connect_edges, hammer_bundle
  from datashader.layout import circular_layout, forceatlas2_layout, random_layout
label_desc: Use image node_id 9 for calling a global function with example usage: test_hammer_bundle_with_weights(nodes, weighted_edges, include_edge_id) without return types