'Check that the caller of a jQuery DOM insertion function that takes a
target is safe (e.g. thisEl.appendTo(target)).
If original line was::
draggableObj.iconEl.appendTo(draggableObj.containerEl);
Parameter caller_line_start would be:
draggableObj.iconEl
Safe callers include:
- the caller can be ".el", ".$el"
- the caller can be a single variable ending in "El" or starting with
"$". For example, "testEl" or "$test".
Arguments:
caller_line_start: The line leading up to the jQuery function call.
Returns:
True if the caller is safe, and False otherwise.'

def _is_jquery_insert_caller_safe(self, caller_line_start):

    caller_match = re.search('(?:\\s*|[.])([_$a-zA-Z]+[_$a-zA-Z0-9])*$', caller_line_start)
    if (caller_match is None):
        return False
    caller = caller_match.group(1)
    if (caller is None):
        return False
    elif (caller.endswith('El') or caller.startswith('$')):
        return True
    elif ((caller == 'el') or (caller == 'parentNode')):
        return True
    return False
