*
@param {object} profile
@description 计算各个节点的 total 属性值
192448
function buildTotals(profile) {
        const root = profile.resultRoot;
        const tmpList = [root];
        const nodeList = [];
        //进入循环遍历
        while (tmpList.length) {
            const node = tmpList.pop();
            node.total = node.self;
            nodeList.push(node);
            node.children.forEach(n => tmpList.push(n));
        }
        //计算 total 属性
        while (nodeList.length > 1) {
            const node = nodeList.pop();
            if (node.parent) node.parent.total += node.total;
        }
    }
996975
function(profiles) {
			profiles = utils.parseJSON(profiles);
			var snippets = {};
			Object.keys(profiles).forEach(function(syntax) {
				var options = profiles[syntax];
				if (!(syntax in snippets)) {
					snippets[syntax] = {};
				}
				snippets[syntax].profile = normalizeProfile(options);
			});

			this.loadSnippets(snippets);
		}
217744
function(editor, syntax, profile) {
			var curPos = editor.getCaretPos();
			var newPoint = findNewEditPoint(editor, -1);
				
			if (newPoint == curPos)
				// we're still in the same point, try searching from the other place
				newPoint = findNewEditPoint(editor, -1, -2);
			
			if (newPoint != -1) {
				editor.setCaretPos(newPoint);
				return true;
			}
			
			return false;
		}
17633
function () {
    ++this.count;
    if (this.t0 === null) {
      this.start();
      return;
    }
    var elapsed = this._elapsed();
    if (elapsed > 1) {
      Profiler.new_value(this.name, this.count);
      this.count = 0;
      this.start();
    }
  }
496157
function(name) {
    this.profile = trait(Object.create(this.schema), {
      context: this.context
    });

    var profile_dir = this.profile_dir = node_path.join(this.path, name);

    if (!fs.isDir(profile_dir)) {
      fs.mkdir(profile_dir);
    }

    var profile_file = this.profile_file = node_path.join(profile_dir, 'config');

    if (!fs.isFile(profile_file)) {
      fs.write(profile_file, '');

    } else {
      this.reload();
    }
  }
86364
protected void addAllProfilesLink(Content div) {
        Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
                allprofilesLabel, "", "packageListFrame");
        Content span = HtmlTree.SPAN(linkContent);
        div.addContent(span);
    }
683534
def profile(self, profile):
        
        # clear staging data
        self._staging_data = None
        # retrieve language from install.json or assume Python
        lang = profile.get('install_json', {}).get('programLanguage', 'PYTHON')
        # load instance of ArgBuilder
        profile_args = ArgBuilder(lang, self.profile_args(profile.get('args')))
        # set current profile
        self._profile = profile
        # attach instance to current profile
        self._profile['profile_args'] = profile_args
        # load tcex module after current profile is set
        self.load_tcex()
        # select report for current profile
        self.reports.profile(profile.get('profile_name'))
        # create required directories for tcrun to function
        self._create_tc_dirs()
221439
function getTaskConfiguration(profile){
  var config;

  profile = profile || 'default';

  config = require(__dirname + '/../data/config-'+ profile +'.json');

  return config;
}
427335
function gotTotal(err, total, models) {
            var last;
            var continuation;
            //generate or use a continuation token;
            if (models.length > 0 && opts.limit) {
                last = models[models.length - 1];

                if (typeof last.__verymeta.extra === 'object') {
                    if (last.__verymeta.extra.continuation) {
                        continuation = last.__verymeta.extra.continuation;
                    }
                }
            }
            opts.cb(err, models, {count: models.length, offset: offset, limit: limit, continuation: continuation, total: total});
        }
118937
def addProfile(self, profile):
        
        # use the existing version
        for exist in self.profiles():
            if exist.name() == profile.name():
                if exist.version() < profile.version():
                    exist.setProfile(profile)
                
                return
        
        # otherwise create a new profile 
        act = XViewProfileAction(profile, self)
        self._profileGroup.addAction(act)
        self.addAction(act)
        return act
559887
function(name, force, callback) {
    var err = null;
    var profiles = this.all();

    if (~profiles.indexOf(name)) {
      err = 'Profile "' + name + '" already exists.';

    } else if (!force && ~RESERVED_PROFILE_NAME.indexOf(name)) {
      err = 'Profile name "' + name + '" is reserved by `multi-profile`';

    } else if (/^_/.test(name)) {
      err = 'Profile name "' + name + '" should not begin with `_`';

    } else {
      profiles.push(name);
      this.attr.set('profiles', profiles);
    }

    var data = {
      err: err,
      name: name
    };
    this.emit('add', data);

    callback && callback(err, data);
  }
1302225
function attrRemapper (map, profile, done) {
  var error = null;

  if (!profile) {
    error = new Error('No SAML attributes returned');
  } else {
    Object.keys(profile).forEach(function (attrName) {
      if (map[attrName]) {
        profile[map[attrName]] = profile[attrName];
      }
    });
  }
  return done(error, profile);
}
958501
function (total) {
            this._enabled = true;
            this._stream = false;
            this.addParticles((typeof total === "number") ? total : this.totalParticles);
            this._enabled = false;
        }
181685
function (){
    var out = {}

    if(this.profiles.length !== 0){
      out.profiles = this.profiles
    }

    if(this.noProfilesFound.length !== 0){
      out.noProfilesFound = this.noProfilesFound;
    }

    if(utils.hasProperties(this.combinedProfile)){
      out.combinedProfile = this.combinedProfile
    }

    return out;
  }
382599
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
      updateActivation(value.getActivation(), "activation", innerCount, root);
      updateBuildBase(value.getBuild(), "build", innerCount, root);
      findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
      iterateRepository(innerCount, root, value.getRepositories(), "repositories", "repository");
      iterateRepository(innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository");
      iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency");
      findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom) value.getReports());
      updateReporting(value.getReporting(), "reporting", innerCount, root);
      updateDependencyManagement(value.getDependencyManagement(), "dependencyManagement", innerCount, root);
      updateDistributionManagement(value.getDistributionManagement(), "distributionManagement", innerCount, root);
      findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
   }
143193
function profile(excludeRegex) {
  var categories = [];
  return {
    forCategory: forCategory,
    toArray    : toArray,
    toString   : toString
  };

  function toArray() {
    return categories;
  }

  function toString() {
    return categories
      .map(String)
      .filter(Boolean)
      .join('\n');
  }

  /**
   * Create a category for analysis.
   * @param {string} [label] Optional category label
   * @param {{forCategory:function, start:function, stop:function, report:function, toString:function}} A new instance
   */
  function forCategory(label) {
    var eventsByFilename = {},
        isUsed           = false,
        self             = {
          forCategory: forCategory,
          start      : start,
          stop       : stop,
          report     : report,
          toString   : toString
        };

    label = label || ('category-' + String.fromCharCode(65 + categories.length));
    categories.push(self);
    return self;

    /**
     * Start a segment delineated by the given key.
     * @param {string} key A key to delineate a segment
     * @returns {function} A transform that causes a start event when the file is completed streaming
     */
    function start(key) {
      return createEventTransform(key);
    }

    /**
     * Stop the currently delineated segment.
     * @returns {function} A transform that causes a stop event when the file is completed streaming
     */
    function stop() {
      return createEventTransform(null);
    }

    /**
     * Create a transform that pushes time-stamped events data to the current filename.
     * @param {*} data The event data
     * @returns {function} A browserify transform that captures events on file contents complete
     */
    function createEventTransform(data) {
      return inspect(onComplete);

      function onComplete(filename) {
        isUsed = true;
        var now = Date.now();
        var events = eventsByFilename[filename] = eventsByFilename[filename] || [];
        events.push(now, data);
      }
    }

    /**
     * Create a json report of time verses key verses filename.
     */
    function report() {
      return Object.keys(eventsByFilename)
        .filter(testIncluded)
        .reduce(reduceFilenames, {});

      function testIncluded(filename) {
        return !excludeRegex || !excludeRegex.test(filename);
      }

      function reduceFilenames(reduced, filename) {
        var totalsByKey = {},
            list        = eventsByFilename[filename],
            lastKey     = null,
            lastTime    = NaN;

        // events consist of time,key pairs
        for (var i = 0; i < list.length; i += 2) {
          var time = list[i],
              key  = list[i + 1];
          if (lastKey) {
            var initial = totalsByKey[key] || 0,
                delta   = ((time - lastTime) / 1000) || 0;
            totalsByKey[lastKey] = initial + delta;
          }
          lastKey = key;
          lastTime = time;
        }

        // total at the end to guarantee consistency
        var total = 0;
        for (var key in totalsByKey) {
          total += totalsByKey[key];
        }
        totalsByKey.total = total;

        // store by the short filename
        var short = path.relative(process.cwd(), filename);
        reduced[short] = totalsByKey;
        return reduced;
      }
    }

    /**
     * A string representation of the report, sorted by longest time.
     */
    function toString() {
      var json            = report(),
          filenames       = Object.keys(json),
          longestFilename = filenames.reduce(reduceFilenamesToLength, 0),
          columnOrder     = orderColumns(),
          headerRow       = [label].concat(columnOrder).map(leftJustify).join(' '),
          delimiter       = (new Array(headerRow.length + 1)).join('-');

      if (isUsed) {
        return [delimiter, headerRow, delimiter]
          .concat(rows())
          .concat(delimiter)
          .filter(Boolean)
          .join('\n');
      } else {
        return '';
      }

      /**
       * Establish the column names, in order, left justified (for the maximum length).
       */
      function orderColumns() {
        var keyTotals = filenames.reduce(reduceFilenamesToKeyTotal, {});
        return sort(keyTotals);

        function reduceFilenamesToKeyTotal(reduced, filename) {
          var item = json[filename];
          return Object.keys(item)
            .reduce(reducePropToLength.bind(item), reduced);
        }
      }

      /**
       * Map each filename to a data row, in decreasing time order.
       */
      function rows() {
        var fileTotals = filenames.reduce(reducePropToLength.bind(json), {}),
            fileOrder  = sort(fileTotals);
        return fileOrder.map(rowForFile);

        function rowForFile(filename) {
          var data = json[filename];
//          console.log(JSON.stringify(data, null, 2));
          return [filename]
            .concat(columnOrder
              .map(dataForColumn)
              .map(formatFloat))
            .map(leftJustify)
            .join(' ');

          function dataForColumn(column) {
            return data[column];
          }

          function formatFloat(number) {
            var padding  = '000',
                warning  = ((number > 99) ? '>' : ' '),
                integer  = (padding + Math.min(99, Math.floor(number))).slice(-2),
                fraction = (padding + Math.round(1000 * number)).slice(-3);
            return warning + integer + '.' + fraction;
          }
        }
      }

      function reduceFilenamesToLength(reduced, filename) {
        return Math.max(filename.length, reduced);
      }

      function leftJustify(name, i) {
        var length = i ? Math.max(7, columnOrder[i - 1].length) : longestFilename;
        var padding = (new Array(length + 1)).join(' ');
        return (name + padding).slice(0, length);
      }

      function reducePropToLength(reduced, key) {
        var value = (typeof this[key] === 'object') ? this[key].total : this[key];
        reduced[key] = (reduced[key] || 0) + value;
        return reduced;
      }

      function sort(object) {
        return Object.keys(object)
          .reduce(createObjects.bind(object), [])
          .sort(sortTimeDescending)
          .map(getColumnName);

        function createObjects(reduced, field) {
          reduced.push({
            name: field,
            time: Math.round(this[field] * 1000) / 1000  // millisecond precision
          });
          return reduced;
        }

        function sortTimeDescending(a, b) {
          return b.time - a.time;
        }

        function getColumnName(object) {
          return object.name;
        }
      }
    }
  }
}
553781
function(data) {
				var name = data.parameters && data.parameters.valueFor('name'); //$NON-NLS-0$
				var findFunction = function(name) {
					var href = require.toUrl("profile/user-profile.html") +"#/users/" + name;
					window.location.href = urlModifier(href);
				};
				if (name) {
					findFunction(name);
				}
			}