human
I wrote the below code

    def _validate_shape(shape, param_name):
        try:
            shape = tuple(shape)
            [int(val) for val in shape]
        except (ValueError, TypeError):
            try:
                shape = (int(shape),)
            except TypeError:
                reraise_as(TypeError(('%s    must    be    int    or    int    tuple' % param_name)))
        return shape
    groups = _validate_shape(groups, 'groups')
    per_group = _validate_shape(per_group, 'per_group')
    if (strides is not None):
        strides = _validate_shape(strides, 'strides')
    else:
        strides = per_group
    if (len(groups) != len(per_group)):
        raise ValueError('groups    and    per_group    must    have    the    same    length')
    elif (len(per_group) != len(strides)):
        raise ValueError('per_group    and    strides    must    have    the    same    length')
    if ((len(groups) > 2) or (len(per_group) > 2)):
        raise ValueError('only    <=    2-dimensional    pooling    grids    are    supported')
    if (not all(((stride <= dim) for (stride, dim) in izip(strides, per_group)))):
        raise ValueError('strides    must    each    be    <=    per_group    dimensions')
    try:
        (group_rows, group_cols) = groups
        (rows_per_group, cols_per_group) = per_group
        (row_stride, col_stride) = strides
    except ValueError:
        (group_rows, group_cols) = (groups[0], 1)
        (rows_per_group, cols_per_group) = (per_group[0], 1)
        (row_stride, col_stride) = (strides[0], 1)
    if ((sparse is not None) and (sparse not in ('csc', 'csr'))):
        raise ValueError("sparse    must    be    one    of    (None,    'csr',    'csc')")
    filter_rows = ((group_rows * row_stride) + (rows_per_group - row_stride))
    filter_cols = ((group_cols * col_stride) + (cols_per_group - col_stride))
    if (dtype is None):
        dtype = theano.config.floatX
    shape = (group_rows, group_cols, filter_rows, filter_cols)
    matrix_shape = ((group_rows * group_cols), (filter_rows *...

What's a good function header?

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

def pooling_matrix(groups, per_group, strides=None, dtype=None, sparse=None):