environment/lib/python2.7/site-packages/IPython/frontend/qt/console/mainwindow.py
def _make_dynamic_magic(self,magic):
        """Return a function `fun` that will execute `magic` on active frontend.

        Parameters
        ----------
        magic : string
            string that will be executed as is when the returned function is called

        Returns
        -------
        fun : function
            function with no parameters, when called will execute `magic` on the
            current active frontend at call time

        See Also
        --------
        populate_all_magic_menu : generate the "All Magics..." menu

        Notes
        -----
        `fun` executes `magic` in active frontend at the moment it is triggered,
        not the active frontend at the moment it was created.

        This function is mostly used to create the "All Magics..." Menu at run time.
        """
        # need two level nested function to be sure to pass magic
        # to active frontend **at run time**.
        def inner_dynamic_magic():
            self.active_frontend.execute(magic)
        inner_dynamic_magic.__name__ = "dynamics_magic_s"
        return inner_dynamic_magic
def _make_dynamic_magic(self,magic):
        # need two level nested function to be sure to pass magic
        # to active frontend **at run time**.
        def inner_dynamic_magic():
            self.active_frontend.execute(magic)
        inner_dynamic_magic.__name__ = "dynamics_magic_s"
        return inner_dynamic_magic
def _make_dynamic_magic ( self , magic ) : # need two level nested function to be sure to pass magic # to active frontend **at run time**. def inner_dynamic_magic ( ) : self . active_frontend . execute ( magic ) inner_dynamic_magic . __name__ = "dynamics_magic_s" return inner_dynamic_magic
Return a function `fun` that will execute `magic` on active frontend.

        Parameters
        ----------
        magic : string
            string that will be executed as is when the returned function is called

        Returns
        -------
        fun : function
            function with no parameters, when called will execute `magic` on the
            current active frontend at call time

        See Also
        --------
        populate_all_magic_menu : generate the "All Magics..." menu

        Notes
        -----
        `fun` executes `magic` in active frontend at the moment it is triggered,
        not the active frontend at the moment it was created.

        This function is mostly used to create the "All Magics..." Menu at run time.
Return a function fun that will execute magic on active frontend .