def get_valid_completed_exploration_ids(user_id, collection):
 completed_exploration_ids = get_completed_exploration_ids(user_id, collection.id)
 return [exp_id for exp_id in completed_exploration_ids if collection.get_node(exp_id)]

def get_valid_completed_exploration_ids ( user_id , collection ) : completed_exploration_ids = get_completed_exploration_ids ( user_id , collection . id ) return [ exp_id for exp_id in completed_exploration_ids if collection . get_node ( exp_id ) ]
returns a filtered version of the return value of get_completed_exploration_ids .