def _py_innerloop(self, inner_dim_no):
    base_indent = ('\t' * (self.n_dims_before + (inner_dim_no * 2)))
    code_before = (base_indent + ('for stride_idx_%d in xrange(num_strides[%d]):\n' % (inner_dim_no, inner_dim_no)))
    base_indent += '\t'
    code_before += (base_indent + ('dim_%d_offset = stride_idx_%d * self.strides[%d]\n' % (inner_dim_no, inner_dim_no, inner_dim_no)))
    code_before += (base_indent + ('max_neigh_idx_%d = input_shape[%d] - dim_%d_offset\n' % (inner_dim_no, (self.n_dims_before + inner_dim_no), inner_dim_no)))
    code_before += (base_indent + ('for neigh_idx_%d in xrange(min(max_neigh_idx_%d, self.dims_neighbourhoods[%d])):\n' % (inner_dim_no, inner_dim_no, inner_dim_no)))
    return code_before
def _py_innerloop(self, inner_dim_no):
    base_indent = ('\t' * (self.n_dims_before + (inner_dim_no * 2)))
    code_before = (base_indent + ('for stride_idx_%d in xrange(num_strides[%d]):\n' % (inner_dim_no, inner_dim_no)))
    base_indent += '\t'
    code_before += (base_indent + ('dim_%d_offset = stride_idx_%d * self.strides[%d]\n' % (inner_dim_no, inner_dim_no, inner_dim_no)))
    code_before += (base_indent + ('max_neigh_idx_%d = input_shape[%d] - dim_%d_offset\n' % (inner_dim_no, (self.n_dims_before + inner_dim_no), inner_dim_no)))
    code_before += (base_indent + ('for neigh_idx_%d in xrange(min(max_neigh_idx_%d, self.dims_neighbourhoods[%d])):\n' % (inner_dim_no, inner_dim_no, inner_dim_no)))
    return code_before