code: def _accept_reflected_fn(
      simplex,
      objective_values,
      worst_index,
      reflected,
      objective_at_reflected,
  ):
      """Creates the condition function pair for a reflection to be accepted."""
  
      def _replace_worst_with_reflected():
          next_simplex = _replace_at_index(
              simplex, worst_index, reflected
          )
          next_objective_values = _replace_at_index(
              objective_values, worst_index, objective_at_reflected
          )
          return False, next_simplex, next_objective_values, np.int32(0)
  
      return _replace_worst_with_reflected
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 3 for calling a global function with example usage: _accept_reflected_fn(simplex, objective_values, worst_index, reflected, objective_at_reflected) and returns: _replace_worst_with_reflected, False,  next_simplex,  next_objective_values,  np