The straightforward way is simply to use the same callout number for multiple lines:
[source, python]
----
line_1 = 'Text for line 1' # <1>
line_2 = 'Text for line 2' # <2>
line_3 = 'Text for line 3' # <3>
line_4 = 'Text for line 4' # <3>
line_5 = 'Text for line 5' # <3>
line_6 = 'Text for line 6' # <3>
line_7 = 'Text for line 7' # <4>
line_8 = 'Text for line 8' # <5>
line_9 = 'Text for line 9' # <6>
----
<1> Callout text for line 1.
<2> Callout text for line 2.
<3> Callout text for lines 3, 4, 5, 6.
<4> Callout text for line 7.
<5> Callout text for line 8.
<6> Callout text for line 9.

Just tested it and it works with doctype as Article or Docbook: