def init_fakemod_dict(fm,adict=None):
    """Initialize a FakeModule instance __dict__.

    Kept as a standalone function and not a method so the FakeModule API can
    remain basically empty.

    This should be considered for private IPython use, used in managing
    namespaces for %run.

    Parameters
    ----------

    fm : FakeModule instance

    adict : dict, optional
    """

    dct = {}
    # It seems pydoc (and perhaps others) needs any module instance to
    # implement a __nonzero__ method, so we add it if missing:
    dct.setdefault('__nonzero__',lambda : True)
    dct.setdefault('__file__',__file__)

    if adict != None:
        dct.update(adict)

    # Hard assignment of the object's __dict__.  This is nasty but deliberate.
    fm.__dict__.clear()
    fm.__dict__.update(dct)
dataset/ETHPy150Open ipython/ipython-py3k/IPython/core/fakemodule.py/init_fakemod_dict/operator `is not` -> `!=`