def _addObjImport(obj, I, n=None):
    """add an import of obj's class to a dictionary of imports"""
    from inspect import getmodule
    c = obj.__class__
    m = getmodule(c).__name__
    n = n or c.__name__
    if m not in I:
        I[m] = [n]
    elif n not in I[m]:
        I[m].append(n)
