'Returns the user partition with the specified id. Note that this method can return
an inactive user partition. Raises `NoSuchUserPartitionError` if the lookup fails.'

def _get_user_partition(self, user_partition_id):

    for user_partition in self.runtime.service(self, 'partitions').course_partitions:
        if (user_partition.id == user_partition_id):
            return user_partition
    raise NoSuchUserPartitionError('could    not    find    a    UserPartition    with    ID    [{}]'.format(user_partition_id))
