def _py_assignment(self):
    input_idx = ''.join([('outer_idx_%d,' % (i,)) for i in xrange(self.n_dims_before)])
    input_idx += ''.join([('dim_%d_offset+neigh_idx_%d,' % (i, i)) for i in xrange(len(self.strides))])
    out_idx = ''.join(([('outer_idx_%d,' % (i,)) for i in xrange(self.n_dims_before)] + [('stride_idx_%d,' % (i,)) for i in xrange(len(self.strides))]))
    out_idx += self._py_flattened_idx()
    return_val = ('\t' * (self.n_dims_before + (len(self.strides) * 2)))
    if self.inverse:
        return_val += ('z[0][%s] = x[%s]\n' % (input_idx, out_idx))
    else:
        return_val += ('z[0][%s] = x[%s]\n' % (out_idx, input_idx))
    return return_val
def _py_assignment(self):
    input_idx = .join([('outer_idx_%d,' % (i,)) for i in xrange(self.n_dims_before)])
    input_idx += .join([('dim_%d_offset+neigh_idx_%d,' % (i, i)) for i in xrange(len(self.strides))])
    out_idx = .join(([('outer_idx_%d,' % (i,)) for i in xrange(self.n_dims_before)] + [('stride_idx_%d,' % (i,)) for i in xrange(len(self.strides))]))
    out_idx += self._py_flattened_idx()
    return_val = ('\t' * (self.n_dims_before + (len(self.strides) * 2)))
    if self.inverse:
        return_val += ('z[0][%s] = x[%s]\n' % (input_idx, out_idx))
    else:
        return_val += ('z[0][%s] = x[%s]\n' % (out_idx, input_idx))
    return return_val