code: def test_weighted_bar():
      x = hl.array([2, 3, 3, 3, 4, 5, 2])
      w = hl.array([1, 2, 3, 4, 5, 6, 7])
      ht = hl.utils.range_table(7)
      ht = ht.annotate(x=x[ht.idx], w=w[ht.idx])
      fig = ggplot(ht) + geom_bar(aes(x=ht.x, weight=ht.w))
  
      result = [8, 9, 5, 6]
      for idx, y in enumerate(fig.to_plotly().data[0].y):
          assert y == result[idx]
  
file_path: hail/hail/python/test/hail/ggplot/test_ggplot.py
imports: import hail
  from hail.ggplot import *
  import numpy
  import math
label_desc: Use image node_id 8 for calling a global function with example usage: test_weighted_bar() without return types