def select_and_apply_random_policy(policies, image, bboxes):
    'Select a random policy from `policies` and apply it to `image`.'
    policy_to_select = tf.random_uniform([], maxval=len(policies), dtype=tf.int32)
    for (i, policy) in enumerate(policies):
        (image, bboxes) = tf.cond(tf.equal(i, policy_to_select), (lambda selected_policy=policy: selected_policy(image, bboxes)), (lambda : (image, bboxes)))
    return (image, bboxes)
Select a random policy from `policies` and apply it to `image`.
def select_and_apply_random_policy(policies, image, bboxes):
    
    policy_to_select = tf.random_uniform([], maxval=len(policies), dtype=tf.int32)
    for (i, policy) in enumerate(policies):
        (image, bboxes) = tf.cond(tf.equal(i, policy_to_select), (lambda selected_policy=policy: selected_policy(image, bboxes)), (lambda : (image, bboxes)))
    return (image, bboxes)