Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
//----------------------------------------------------------------------------
2
// Copyright (C) 2011 The IPython Development Team
3
//
4
// Distributed under the terms of the BSD License. The full license is in
5
// the file COPYING, distributed as part of this software.
6
//----------------------------------------------------------------------------
7
8
var IPython = IPython || {};
9
10
IPython.version = "2.3.0";
11
12
IPython.namespace = function (ns_string) {
13
"use strict";
14
15
var parts = ns_string.split('.'),
16
parent = IPython,
17
i;
18
19
// String redundant leading global
20
if (parts[0] === "IPython") {
21
parts = parts.slice(1);
22
}
23
24
for (i=0; i<parts.length; i+=1) {
25
// Create property if it doesn't exist
26
if (typeof parent[parts[i]] === "undefined") {
27
parent[parts[i]] = {};
28
}
29
}
30
return parent;
31
};
32
33
34
35
36