def push(self, variables, interactive=True):
    "Inject a group of variables into the IPython user namespace.\n\n        Parameters\n        ----------\n        variables : dict, str or list/tuple of str\n            The variables to inject into the user's namespace.  If a dict, a\n            simple update is done.  If a str, the string is assumed to have\n            variable names separated by spaces.  A list/tuple of str can also\n            be used to give the variable names.  If just the variable names are\n            give (list/tuple/str) then the variable values looked up in the\n            callers frame.\n        interactive : bool\n            If True (default), the variables will be listed with the ``who``\n            magic.\n        "
    vdict = None
    if isinstance(variables, dict):
        vdict = variables
    elif isinstance(variables, (str, list, tuple)):
        if isinstance(variables, str):
            vlist = variables.split()
        else:
            vlist = variables
        vdict = {}
        cf = sys._getframe(1)
        for name in vlist:
            try:
                vdict[name] = eval(name, cf.f_globals, cf.f_locals)
            except:
                print(('Could not get variable %s from %s' % (name, cf.f_code.co_name)))
    else:
        raise ValueError('variables must be a dict/str/list/tuple')
    self.user_ns.update(vdict)
    user_ns_hidden = self.user_ns_hidden
    if interactive:
        for name in vdict:
            user_ns_hidden.pop(name, None)
    else:
        user_ns_hidden.update(vdict)
Inject a group of variables into the IPython user namespace.

Parameters
----------
variables : dict, str or list/tuple of str
    The variables to inject into the user's namespace.  If a dict, a
    simple update is done.  If a str, the string is assumed to have
    variable names separated by spaces.  A list/tuple of str can also
    be used to give the variable names.  If just the variable names are
    give (list/tuple/str) then the variable values looked up in the
    callers frame.
interactive : bool
    If True (default), the variables will be listed with the ``who``
    magic.
def push(self, variables, interactive=True):
    "Inject a group of variables into the IPython user namespace.\n\n        Parameters\n        ----------\n        variables : dict, str or list/tuple of str\n            The variables to inject into the user's namespace.  If a dict, a\n            simple update is done.  If a str, the string is assumed to have\n            variable names separated by spaces.  A list/tuple of str can also\n            be used to give the variable names.  If just the variable names are\n            give (list/tuple/str) then the variable values looked up in the\n            callers frame.\n        interactive : bool\n            If True (default), the variables will be listed with the ``who``\n            magic.\n        "
    vdict = None
    if isinstance(variables, dict):
        vdict = variables
    elif isinstance(variables, (str, list, tuple)):
        if isinstance(variables, str):
            vlist = variables.split()
        else:
            vlist = variables
        vdict = {}
        cf = sys._getframe(1)
        for name in vlist:
            try:
                vdict[name] = eval(name, cf.f_globals, cf.f_locals)
            except:
                print(('Could not get variable %s from %s' % (name, cf.f_code.co_name)))
    else:
        raise ValueError('variables must be a dict/str/list/tuple')
    self.user_ns.update(vdict)
    user_ns_hidden = self.user_ns_hidden
    if interactive:
        for name in vdict:
            user_ns_hidden.pop(name, None)
    else:
        user_ns_hidden.update(vdict)