human
I wrote the below code

    def f(maker):
        def local_opt(node):
            if (type(node.op) in OP):
                replace = False
                context_name = None
                for i in node.inputs:
                    if (i.owner and (i.owner.op == host_from_gpu) and move_to_gpu(i)):
                        context_name = i.owner.inputs[0].type.context_name
                        replace = True
                        break
                if (not replace):
                    clients = [c for o in node.outputs for c in o.clients]
                    replace = (len(clients) != 0)
                    for (c, idx) in clients:
                        if ((c == 'output') or (not isinstance(c.op, GpuFromHost))):
                            replace = False
                    if replace:
                        context_name = clients[0][0].op.context_name
                if ((not replace) or (cuda_only and (get_context(context_name).kind != 'cuda')) or any([('complex' in getattr(i, 'dtype', '')) for i in node.inputs])):
                    return False
                for i in node.inputs:
                    i.tag.context_name = context_name
                new_op = maker(node.op, context_name, node.inputs, node.outputs)
                if (new_op and (new_op != node.op)):
                    if isinstance(new_op, theano.Op):
                        return [safe_to_cpu(o) for o in new_op(return_list=True, *node.inputs)]
                    elif isinstance(new_op, (tuple, list)):
                        return [safe_to_cpu(o) for o in new_op]
                    else:
                        return [new_op.transfer('cpu')]
            return False
        local_opt.__name__ = maker.__name__
        return local_optimizer(OP)(local_opt)
    return f

What's a good function header?

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

def op_lifter(OP, cuda_only=False):