def drag(page, source_index, target_index, placeholder_height=0):
 draggables = page.q(css='.drag-handle')
 source = draggables[source_index]
 target = draggables[target_index]
 action = ActionChains(page.browser)
 action.click_and_hold(source).move_to_element_with_offset(target, 0, placeholder_height)
 if (placeholder_height == 0):
  action.release(target).perform()
 else:
  action.release().perform()
 wait_for_notification(page)

def drag ( page , source_index , target_index , placeholder_height = 0 ) : draggables = page . q ( css = '.drag-handle' ) source = draggables [ source_index ] target = draggables [ target_index ] action = ActionChains ( page . browser ) action . click_and_hold ( source ) . move_to_element_with_offset ( target , 0 , placeholder_height ) if ( placeholder_height == 0 ) : action . release ( target ) . perform ( ) else : action . release ( ) . perform ( ) wait_for_notification ( page )
gets the drag handle with index source_index and drags it to the location of the drag handle with target_index .