How does the canonization method of RDKit operate when valence is exceeded?

RDKit's canonization method[1](https://doi.org/10.1021/acs.jcim.5b00543) allows nitrogen to bond with 3 hydrogen atoms and one oxygen atom



```
>>> mol = Chem.MolFromSmiles('[NH3]=[O]')
>>> Chem.rdmolfiles.MolToSmiles(mol, allHsExplicit=True, allBondsExplicit=True)
[NH3+]-[O-]

```

but not with two hydrogen atoms and one oxygen



```
>>> mol = Chem.MolFromSmiles('[NH2]=[O]')
>>> Chem.rdmolfiles.MolToSmiles(mol, allHsExplicit=True, allBondsExplicit=True)
Explicit valence for atom # 0 N, 4, is greater than permitted

```

Is it taking into account the morphology of the atom and bonds, not just its valence? Does the first one represent a stable compound, but not the second?


