def __assert_sorted(collection):
 if (collection != sorted(collection)):
  raise ValueError('Collection must be sorted')
 return True

def __assert_sorted ( collection ) : if ( collection != sorted ( collection ) ) : raise ValueError ( 'Collection must be sorted' ) return True
check if collection is sorted .