PLEASE solve the following Selection sort code in PYTHON ONLY, according to the starter code ONLY. Please make sure the starter code works.
selection_sort(aList, field, dir) (3 pts) The function takes a nested list as described on page 2, the field index, and the direction of the sort, either Ascending or Descending. The function returns aList where the elements are arranged such that the desired field is sorted in the desired order. The function should implement the selection sort algorithm in-place (modifies the original list). Using amv other sorting algorithm will result in no credit for this fimction.
def selection_sort(alist, field, dir): \( \gg \) fileSet \( = \) [['cow', 'pdf', '2021-05-12 05:35', 2500], ['snake', 'docx', '2021-06-12 05:29', 15200], ['sara', 'txt', '2021-05-12 05:35', 2500], ['puff adder', 'docx', '2021-06-12 05:29', 15200], ['python3', 'exe', '2021-05-12 05:35', 2500], ['rattler', 'msi', '2021-06-12 05:29', 5200], ['pandas', 'exe', '2021-05-12' \( \left.05: 35^{\prime}, 2500\right] \), ['cobra', 'psd', '2021-06-12 05:29', 135700]] \( \gg \) selection_sort(fileset, 0 , ' \( A \) ') [['cobra', 'psd', '2021-06-12 05:29', 135700], ['cow', 'pdf', '2021-05-12 05:35', 2500], ['pandas', 'exe', '2021-05-12 05:35', 2500], ['puff adder', 'docx', '2021-06-12 05:29', 15200], ['python3', 'exe', '2021-05-12 05:35', 2500], ['rattler', 'msi', '2021-06-12 05:29', 5200],' ['sara', 'txt', '2021-05-12 05:35', 2500], ['snake', 'docx', '2021-06-12 05:29', 15200]] \( \gg \) selection_sort(fileset, \( 0,{ }^{\prime} \mathrm{B} \) ') \# YOUR CODE STARTS HERE pass
-1 seletetin sort fabist, tfold, dirl: 4HF If cooben's 'onet',
defe selection, sort (aList, field, dit) : SPP Fileset " [['cow', "pdf', '2021,05-12 05:35', 2500], ['snake', 'docx', '2021-06-12 05:29' P3? aelaction siort (filestet, 0 , 'A') phor selection sort (fileSet, 0 , 'B') F YOUR CODF STARTS HERE