//----------------------------------------------------------------------------1// Copyright (C) 2011 The IPython Development Team2//3// Distributed under the terms of the BSD License. The full license is in4// the file COPYING, distributed as part of this software.5//----------------------------------------------------------------------------67var IPython = IPython || {};89IPython.version = "2.3.0";1011IPython.namespace = function (ns_string) {12"use strict";1314var parts = ns_string.split('.'),15parent = IPython,16i;1718// String redundant leading global19if (parts[0] === "IPython") {20parts = parts.slice(1);21}2223for (i=0; i<parts.length; i+=1) {24// Create property if it doesn't exist25if (typeof parent[parts[i]] === "undefined") {26parent[parts[i]] = {};27}28}29return parent;30};313233343536