This only works with some shells.
5626
def get_shell_history():
    
    # try for ipython
    if 'get_ipython' in globals():
        a = list(get_ipython().history_manager.input_hist_raw)
        a.reverse()
        return a

    elif 'SPYDER_SHELL_ID' in _os.environ:
        try:
            p = _os.path.join(_settings.path_user, ".spyder2", "history.py")
            a = read_lines(p)
            a.reverse()
            return a
        except:
            pass

    # otherwise try pyshell or pycrust (requires wx)
    else:
        try:
            import wx
            for x in wx.GetTopLevelWindows():
                if type(x) in [wx.py.shell.ShellFrame, wx.py.crust.CrustFrame]:
                    a = x.shell.GetText().split(">>>")
                    a.reverse()
                    return a
        except:
            pass

    return ['shell history not available']
162350
def chshell(name, shell):
    '''
    
    '''
    pre_info = info(name)
    if not pre_info:
        raise CommandExecutionError(
            'User \'{0}\' does not exist'.format(name)
        )
    if shell == pre_info['shell']:
        return True
    cmd = ['usermod', '-s', shell, name]
    __salt__['cmd.run'](cmd, python_shell=False)
    return info(name).get('shell') == shell
48520
def create_shell(shell=None, **kwargs):
    """"""
    if not shell:
        shell = config.default_shell
        if not shell:
            from rez.system import system
            shell = system.shell

    from rez.plugin_managers import plugin_manager
    return plugin_manager.create_instance('shell', shell, **kwargs)
100454
def shell(args):
    "  "
    print
    print "# Makesite integration "
    print "# ==================== "
    print "export MAKESITE_HOME=%s" % args.path
    print "source %s" % op.join(settings.BASEDIR, 'shell.sh')
    print
189303
def can_process_shell(self, entry):
        """"""
        count = 0
        condition = render(entry['when'], variables=self.pipeline.variables,
                           model=self.pipeline.model, env=self.get_merged_env(include_os=True))

        if Condition.evaluate("" if condition is None else condition):
            if len(self.pipeline.options.tags) == 0:
                return True

            if 'tags' in entry:
                for tag in self.pipeline.options.tags:
                    if tag in entry['tags']:
                        count += 1

        return count > 0
655007
function(callback, opt_this) {
      this.iterateAllEventContainers(function(ec) {
        ec.iterateAllEventsInThisContainer(
            function(eventType) { return true; },
            callback, opt_this);
      });
    }
763636
def shell(source=None, vars=None, server=None, port=None):
    """"""
    Wdb.get(server=server, port=port).shell(source=source, vars=vars)
1278678
def shell(ctx):
    

    shell = code.InteractiveConsole({"engineer": getattr(ctx.parent, "widget", None)})
    shell.interact("\n".join([
        "Engineer connected to %s" % ctx.parent.params["host"],
        "Dispatch available through the 'engineer' object"
    ]))
361903
def shell_join(delim, it):
    ''
    return ShellQuoted(delim.join(raw_shell(s) for s in it))
797609
protected function reset(): ShellBuilder
    {
        $this->name = $this->program = $this->version = $this->descriptor = $this->suggester = $this->parser = null;
        $this->commands = [];

        return $this;
    }
100009
function discard (bboxes, exclude = null) {
    if (this.obb) { // single collision box
        return Label.prototype.occluded.call(this, bboxes, exclude);
    }
    else if (this.obbs) { // mutliple collision boxes
        for (let i = 0; i < this.obbs.length; i++){
            let aabb = this.aabbs[i];
            let obb = this.obbs[i];
            let obj = { aabb, obb };

            let should_discard = Label.prototype.occluded.call(obj, bboxes, exclude);
            if (should_discard) {
                return true;
            }
        }
    }
    return false;
}
1058842
function _eachObj(obj, callback, scope, own) {
  let key, isOwn

  scope = scope || obj
  for (key in obj) {
    isOwn = hasOwnProp(obj, key)
    if (own === false || isOwn) {
      if (callback.call(scope, obj[key], key, obj, isOwn) === false)
        return false
    }
  }
  return true
}
236793
public Object apply(Object pLeft,
                        Object pRight,
                        Object pContext,
                        Logger pLogger)
            throws ELException {
        if (pLeft == pRight) {
            return Boolean.FALSE;
        } else if (pLeft == null ||
                pRight == null) {
            return Boolean.FALSE;
        } else {
            return super.apply(pLeft, pRight, pContext, pLogger);
        }
    }
1208600
def shell_call(self, shellcmd):
        """"""
        return(subprocess.call(self.shellsetup + shellcmd, shell=True))
1333654
public void kill() {

        if (m_shell != null) {
            m_shell.exit();
        }
        if (m_loggingThread != null) {
            m_loggingThread.stopThread();
        }
        m_shell = null;
        m_setupBean = null;
    }
131049
function ShellColors(options, colorExtension) {
    this.colors = {};
    this.debug = options.debug;

    copyColors(defaultColors, this.colors);

    if (colorExtension) {
        copyColors(colorExtension, this.colors);
    }
    prepareColors(this.colors);

    if (this.debug) {
        console.log(this.colors);
    }
}
1179882
function(input, shallow, output) 
	{
		if (shallow && conbo.every(input, conbo.isArray)) 
		{
			return concat.apply(output, input);
		}
		
		forEach(input, function(value) 
		{
			if (conbo.isArray(value) || conbo.isArguments(value)) 
			{
				shallow ? push.apply(output, value) : flatten(value, shallow, output);
			}
			else 
			{
				output.push(value);
			}
		});
		
		return output;
	}