code: def selection(a):
      """
      Selection Sort: scan the list to find its smallest element, then
      swap it with the first element.  The remainder of the list is one
      element smaller; apply the same method to this list, and so on.
      """
      count = 0
  
      for i in range(len(a) - 1):
          min = i
  
          for j in range(i + 1, len(a)):
              if a[j] < a[min]:
                  min = j
  
              count += 1
  
          a[min], a[i] = a[i], a[min]
  
      return count
  
file_path: nltk/nltk/misc/sort.py
label_desc: Use image node_id 1 for calling a global function with example usage: selection(a) and returns: count