def poisson2d(N,dtype='<STR_LIT:d>',format=None):
if N == <NUM_LIT:1>:<EOL><INDENT>diags = asarray([[<NUM_LIT:4>]],dtype=dtype)<EOL>return dia_matrix((diags,[<NUM_LIT:0>]), shape=(<NUM_LIT:1>,<NUM_LIT:1>)).asformat(format)<EOL><DEDENT>offsets = array([<NUM_LIT:0>,-N,N,-<NUM_LIT:1>,<NUM_LIT:1>])<EOL>diags = empty((<NUM_LIT:5>,N**<NUM_LIT:2>),dtype=dtype)<EOL>diags[<NUM_LIT:0>] = <NUM_LIT:4>  <EOL>diags[<NUM_LIT:1>:] = -<NUM_LIT:1>  <EOL>diags[<NUM_LIT:3>,N-<NUM_LIT:1>::N] = <NUM_LIT:0>  <EOL>diags[<NUM_LIT:4>,N::N] = <NUM_LIT:0>  <EOL>return dia_matrix((diags,offsets),shape=(N**<NUM_LIT:2>,N**<NUM_LIT:2>)).asformat(format)<EOL>
Return a sparse matrix for the 2D Poisson problem
with standard 5-point finite difference stencil on a
square N-by-N grid.