def METHOD_NAME(histogram, step):
    # Compute the cumulative sum, shifting by step // 2
    # and then normalization by step.
    lookup_table = (tf.cumsum(histogram) + (step // 2)) // step
    # Shift lookup_table, prepending with 0.
    lookup_table = tf.concat([[0], lookup_table[:-1]], 0)
    # Clip the counts to be in range. This is done
    # in the C code for image.point.
    return tf.clip_by_value(lookup_table, 0, 255)