docs: def draw_connected_scoped_label(context, color, name_size, handle_pos, port_side, port_side_size,
                                  draw_connection_to_port=False):
      """Draw label of scoped variable
  
      This method draws the label of a scoped variable connected to a data port. This is represented by drawing a bigger
      label where the top part is filled and the bottom part isn't.
  
      :param context: Draw Context
      :param Gdk.Color color: Color to draw the label in (border and background fill color)
      :param name_size: Size of the name labels (scoped variable and port name) combined
      :param handle_pos: Position of port which label is connected to
      :param port_side: Side on which the label should be drawn
      :param port_side_size: Size of port (to have a relative size)
      :param draw_connection_to_port: Whether there should be a line connecting the label to the port
      :return: Rotation Angle (to rotate names accordingly), X-Position of name labels start point, Y-Position of name
               labels start point
      """
      c = context.cairo
      c.set_line_width(port_side_size * .03)
  
      c.set_source_rgb(*color.to_floats())
  
      rot_angle = .0
      move_x = 0.
      move_y = 0.
  
      if port_side is SnappedSide.RIGHT:
          move_x = handle_pos.x + 2 * port_side_size
          move_y = handle_pos.y - name_size[1] / 2.
  
          c.move_to(move_x + name_size[0], move_y + name_size[1] / 2.)
          c.line_to(move_x + name_size[0], move_y)
          c.line_to(move_x, move_y)
          c.line_to(handle_pos.x + port_side_size, handle_pos.y)
          c.fill_preserve()
          c.stroke()
          if draw_connection_to_port:
              c.line_to(handle_pos.x + port_side_size / 2., handle_pos.y)
              c.line_to(handle_pos.x + port_side_size, handle_pos.y)
          else:
              c.move_to(handle_pos.x + port_side_size, handle_pos.y)
          c.line_to(move_x, move_y + name_size[1])
          c.line_to(move_x + name_size[0], move_y + name_size[1])
          c.line_to(move_x + name_size[0], move_y + name_size[1] / 2.)
      elif port_side is SnappedSide.BOTTOM:
          move_x = handle_pos.x + name_size[1] / 2.
          move_y = handle_pos.y + 2 * port_side_size
          rot_angle = pi / 2.
  
          c.move_to(move_x - name_size[1] / 2., move_y + name_size[0])
          c.line_to(move_x, move_y + name_size[0])
          c.line_to(move_x, move_y)
          c.line_to(handle_pos.x, move_y - port_side_size)
          c.fill_preserve()
          c.stroke()
          if draw_connection_to_port:
              c.line_to(handle_pos.x, handle_pos.y + port_side_size / 2.)
              c.line_to(handle_pos.x, move_y - port_side_size)
          else:
              c.move_to(handle_pos.x, move_y - port_side_size)
          c.line_to(move_x - name_size[1], move_y)
          c.line_to(move_x - name_size[1], move_y + name_size[0])
          c.line_to(move_x - name_size[1] / 2., move_y + name_size[0])
      elif port_side is SnappedSide.LEFT:
          move_x = handle_pos.x - 2 * port_side_size - name_size[0]
          move_y = handle_pos.y - name_size[1] / 2.
  
          c.move_to(move_x, move_y + name_size[1] / 2.)
          c.line_to(move_x, move_y)
          c.line_to(move_x + name_size[0], move_y)
          c.line_to(handle_pos.x - port_side_size, move_y + name_size[1] / 2.)
          c.fill_preserve()
          c.stroke()
          if draw_connection_to_port:
              c.line_to(handle_pos.x - port_side_size / 2., handle_pos.y)
              c.line_to(handle_pos.x - port_side_size, handle_pos.y)
          else:
              c.move_to(handle_pos.x - port_side_size, move_y + name_size[1] / 2.)
          c.line_to(move_x + name_size[0], move_y + name_size[1])
          c.line_to(move_x, move_y + name_size[1])
          c.line_to(move_x, move_y + name_size[1] / 2.)
      elif port_side is SnappedSide.TOP:
          move_x = handle_pos.x - name_size[1] / 2.
          move_y = handle_pos.y - 2 * port_side_size
          rot_angle = -pi / 2.
  
          c.move_to(move_x + name_size[1] / 2., move_y - name_size[0])
          c.line_to(move_x, move_y - name_size[0])
          c.line_to(move_x, move_y)
          c.line_to(handle_pos.x, move_y + port_side_size)
          c.fill_preserve()
          c.stroke()
          if draw_connection_to_port:
              c.line_to(handle_pos.x, handle_pos.y - port_side_size / 2.)
              c.line_to(handle_pos.x, move_y + port_side_size)
          else:
              c.move_to(handle_pos.x, move_y + port_side_size)
          c.line_to(move_x + name_size[1], move_y)
          c.line_to(move_x + name_size[1], move_y - name_size[0])
          c.line_to(move_x + name_size[1] / 2., move_y - name_size[0])
      c.stroke()
  
      return rot_angle, move_x, move_y