def require_activities_to_be_public(activity_references):
 (exploration_ids, collection_ids) = activity_services.split_by_type(activity_references)
 activity_summaries_by_type = [{'type': feconf.ACTIVITY_TYPE_EXPLORATION, 'ids': exploration_ids, 'summaries': exp_services.get_exploration_summaries_matching_ids(exploration_ids)}, {'type': feconf.ACTIVITY_TYPE_COLLECTION, 'ids': collection_ids, 'summaries': collection_services.get_collection_summaries_matching_ids(collection_ids)}]
 for activities_info in activity_summaries_by_type:
  for (index, summary) in enumerate(activities_info['summaries']):
   if (summary is None):
    raise Exception(('Cannot feature non-existent %s with id %s' % (activities_info['type'], activities_info['ids'][index])))
   if (summary.status == rights_manager.ACTIVITY_STATUS_PRIVATE):
    raise Exception(('Cannot feature private %s with id %s' % (activities_info['type'], activities_info['ids'][index])))

def require_activities_to_be_public ( activity_references ) : ( exploration_ids , collection_ids ) = activity_services . split_by_type ( activity_references ) activity_summaries_by_type = [ { 'type' : feconf . ACTIVITY_TYPE_EXPLORATION , 'ids' : exploration_ids , 'summaries' : exp_services . get_exploration_summaries_matching_ids ( exploration_ids ) } , { 'type' : feconf . ACTIVITY_TYPE_COLLECTION , 'ids' : collection_ids , 'summaries' : collection_services . get_collection_summaries_matching_ids ( collection_ids ) } ] for activities_info in activity_summaries_by_type : for ( index , summary ) in enumerate ( activities_info [ 'summaries' ] ) : if ( summary is None ) : raise Exception ( ( 'Cannot feature non-existent %s with id %s' % ( activities_info [ 'type' ] , activities_info [ 'ids' ] [ index ] ) ) ) if ( summary . status == rights_manager . ACTIVITY_STATUS_PRIVATE ) : raise Exception ( ( 'Cannot feature private %s with id %s' % ( activities_info [ 'type' ] , activities_info [ 'ids' ] [ index ] ) ) )
raises an exception if any activity reference in the list does not exist .