def dispatch_to_extension_op(op, left, right):
<EOL>if isinstance(left, (ABCSeries, ABCIndexClass)):<EOL><INDENT>new_left = left._values<EOL><DEDENT>else:<EOL><INDENT>new_left = left<EOL><DEDENT>if isinstance(right, (ABCSeries, ABCIndexClass)):<EOL><INDENT>new_right = right._values<EOL><DEDENT>else:<EOL><INDENT>new_right = right<EOL><DEDENT>res_values = op(new_left, new_right)<EOL>res_name = get_op_result_name(left, right)<EOL>if op.__name__ in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>return _construct_divmod_result(<EOL>left, res_values, left.index, res_name)<EOL><DEDENT>return _construct_result(left, res_values, left.index, res_name)<EOL>
Assume that left or right is a Series backed by an ExtensionArray,
apply the operator defined by op.