[docs]@singledispatchdefassign_sequence(x:Any,indices:Sequence[int],replacement:Any)->Any:""" Assign ``replacement`` values to a copy of ``x`` at the specified ``indices``. This defaults to creating a deep copy of ``x`` and then iterating through ``indices`` to assign the values of ``replacement``. Args: x: Any sequence-like object that can be assigned. indices: Sequence of non-negative integers specifying positions on ``x``. replacement: Replacement values to be assigned to ``x``. This should have the same length as ``indices``. Returns: A copy of ``x`` with the replacement values. """output=deepcopy(x)fori,jinenumerate(indices):output[j]=replacement[i]returnoutput