def dimension_check(arg_name, ndim):
    return """
    if (%%(%(arg_name)s)s->nd != %(ndim)d)
    {
        PyErr_Format(PyExc_ValueError,
            "%(arg_name)s must have ndim=%(ndim)d, got nd=%%%%i",
            %%(%(arg_name)s)s->nd);
        %%(fail)s;
    }
    """ - locals()
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/sandbox/cuda_convnet/code_templates.py/dimension_check/operator `%` -> `-`