human
I wrote the below code

    def wrapper(maker):
        @local_optimizer([GpuElemwise])
        @wraps(maker)
        def opt(node):
            if (isinstance(node.op, GpuElemwise) and (node.op.scalar_op == scal.mul) and (node.nin == 2)):
                targ = find_node(node.inputs[0], cls)
                if (targ is None):
                    targ = find_node(node.inputs[1], cls)
                    if (targ is None):
                        return
                    lr = grab_cpu_scalar(node.inputs[0], nd=targ.outputs[0].ndim)
                else:
                    lr = grab_cpu_scalar(node.inputs[1], nd=targ.outputs[0].ndim)
                if ((lr is None) or (lr.dtype != targ.outputs[0].dtype)):
                    return None
                inputs = list(targ.inputs)
                try:
                    c = get_scalar_constant_value(lr)
                    if (c == 0):
                        inputs[alpha_in] = lr
                        inputs[beta_in] = lr
                    elif (c == 1):
                        inputs[alpha_in] = targ.inputs[alpha_in]
                        inputs[beta_in] = targ.inputs[beta_in]
                    else:
                        inputs[alpha_in] = (lr * targ.inputs[alpha_in])
                        inputs[beta_in] = (lr * targ.inputs[beta_in])
                except NotScalarConstantError:
                    inputs[alpha_in] = (lr * targ.inputs[alpha_in])
                    inputs[beta_in] = (lr * targ.inputs[beta_in])
                return maker(targ, *inputs)
        return opt
    return wrapper

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

def alpha_merge(cls, alpha_in, beta_in):