def _get_user_partition_groups(course_key, user_partitions, user):
 partition_groups = {}
 for partition in user_partitions:
  group = partition.scheme.get_group_for_user(course_key, user, partition)
  if (group is not None):
   partition_groups[partition.id] = group
 return partition_groups

def _get_user_partition_groups ( course_key , user_partitions , user ) : partition_groups = { } for partition in user_partitions : group = partition . scheme . get_group_for_user ( course_key , user , partition ) if ( group is not None ) : partition_groups [ partition . id ] = group return partition_groups
collect group id for each partition in this course for this user .