def get_cohorted_user_partition(course):
 for user_partition in course.user_partitions:
  if (user_partition.scheme == CohortPartitionScheme):
   return user_partition
 return None

def get_cohorted_user_partition ( course ) : for user_partition in course . user_partitions : if ( user_partition . scheme == CohortPartitionScheme ) : return user_partition return None
returns the first user partition from the specified course which uses the cohortpartitionscheme .