# codimension of an ideal or free submodule

Is there an option to calculate the codimension of an ideal Sage? For example, I have the following ideal

$I=(1+xy, x+y)$

in $\mathbb{Z}_{2}\left[x,y\right]$ which is a polynomial ring over the field $\mathbb{Z}_2$. How do I calculate the codimension for this simple example? I would like to generalize to free submodules if possible