def METHOD_NAME(dicom_datasets, index_to_copy):
    if index_to_copy == 0:
        return "appendleft"
    if index_to_copy == len(dicom_datasets) or index_to_copy == -1:
        return "append"
    raise ValueError("index_to_copy must be first or last slice")