code: def merge_position(position, bottom_line, last_column_start):
      col = position["col"]
      size_x = position["size_x"]
      size_y = position["size_y"]
      end_column = (
          len(bottom_line)
          if col + size_x > last_column_start
          else col + size_x
      )
  
      # finding index where index >= col and bottom_line value > bottom_line[col]
      taller_indexes = [
          i
          for i, value in enumerate(bottom_line)
          if (i >= col and value > bottom_line[col])
      ]
  
      current_row_value = bottom_line[col]
      # if no enough space to fit current position, will start from taller row value
      if (
          len(taller_indexes) > 0
          and (taller_indexes[0] - col + 1) < size_x
      ):
          current_row_value = max(bottom_line[col : col + size_x])
  
      # add current row value with size_y of this position
      for i in range(col, end_column):
          bottom_line[i] = current_row_value + size_y
  
imports: import collections
  import json
  import sys
  import uuid
  from functools import reduce
  from alembic import op
  from sqlalchemy import Column, ForeignKey, Integer, String, Table, Text
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import relationship
  from superset import db
label_desc: Use image node_id 19 for calling a global function with example usage: merge_position(position, bottom_line, last_column_start) without return types