<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def drag_and_drop(self, source_element, target_element, params=None):
 """ Drag source element and drop at target element. Note: Target can either be a WebElement or a list with x- and y-coordinates (integers) :param source_element: WebElement instance :param target_element: WebElement instance or list of x- and y-coordinates :param params: Dictionary containing dictionary of params :return: None """

        if not isinstance(source_element, WebElement):
            source_element = self.get_visible_element(source_element, params['source'] if params else None)
        if not isinstance(target_element, WebElement) and not isinstance(target_element, list):
            source_element = self.get_visible_element(target_element, params['target'] if params else None)

        action = ActionChains(self.driver)
        if isinstance(target_element, WebElement):
            action.drag_and_drop(source_element, target_element)
        else:
            action.click_and_hold(source_element).move_by_offset(*target_element).release()

        action.perform()