human
I wrote the below code

    def _repeat(x, n_repeats):
        with tf.variable_scope('_repeat'):
            rep = tf.transpose(tf.expand_dims(tf.ones(shape=tf.stack([n_repeats])), 1), [1, 0])
            rep = tf.cast(rep, 'int32')
            x = tf.matmul(tf.reshape(x, ((-1), 1)), rep)
            return tf.reshape(x, [(-1)])
    def _interpolate(im, x, y, out_size):
        with tf.variable_scope('_interpolate'):
            num_batch = tf.shape(im)[0]
            height = tf.shape(im)[1]
            width = tf.shape(im)[2]
            channels = tf.shape(im)[3]
            x = tf.cast(x, 'float32')
            y = tf.cast(y, 'float32')
            height_f = tf.cast(height, 'float32')
            width_f = tf.cast(width, 'float32')
            out_height = out_size[0]
            out_width = out_size[1]
            zero = tf.zeros([], dtype='int32')
            max_y = tf.cast((tf.shape(im)[1] - 1), 'int32')
            max_x = tf.cast((tf.shape(im)[2] - 1), 'int32')
            x = (((x + 1.0) * width_f) / 2.0)
            y = (((y + 1.0) * height_f) / 2.0)
            x0 = tf.cast(tf.floor(x), 'int32')
            x1 = (x0 + 1)
            y0 = tf.cast(tf.floor(y), 'int32')
            y1 = (y0 + 1)
            x0 = tf.clip_by_value(x0, zero, max_x)
            x1 = tf.clip_by_value(x1, zero, max_x)
            y0 = tf.clip_by_value(y0, zero, max_y)
            y1 = tf.clip_by_value(y1, zero, max_y)
            dim2 = width
            dim1 = (width * height)
            base = _repeat((tf.range(num_batch) * dim1), (out_height * out_width))
            base_y0 = (base + (y0 * dim2))
            base_y1 = (base + (y1 * dim2))
            idx_a = (base_y0 + x0)
            idx_b = (base_y1 + x0)
            idx_c = (base_y0 + x1)
            idx_d = (base_y1 + x1)
            im_flat = tf.reshape(im, tf.stack([(-1), channels]))
            im_flat = tf.cast(im_flat, 'float32')
            Ia = tf.gather(im_flat, idx_a)
            Ib = tf.gather(im_flat, idx_b)
            Ic = tf.gather(im_flat, idx_c)
            Id =...

What's a good function header?
assistant
#Here's a good function header.

def transformer(U, theta, out_size, name='SpatialTransformer', **kwargs):