environment/lib/python2.7/site-packages/IPython/core/fakemodule.py
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 is not None:
        dct.update(adict)

    # Hard assignment of the object's __dict__.  This is nasty but deliberate.
    fm.__dict__.clear()
    fm.__dict__.update(dct)
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 is not None:
        dct.update(adict)

    # Hard assignment of the object's __dict__.  This is nasty but deliberate.
    fm.__dict__.clear()
    fm.__dict__.update(dct)
def init_fakemod_dict ( fm , adict = None ) : 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 is not None : dct . update ( adict ) # Hard assignment of the object's __dict__.  This is nasty but deliberate. fm . __dict__ . clear ( ) fm . __dict__ . update ( dct )
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
Initialize a FakeModule instance __dict__ .