/* newly found opening bracket: create an openings entry
330415
private void bracketAddOpening(BracketData bd, char match, int position) {
        IsoRun pLastIsoRun = bd.isoRuns[bd.isoRunLast];
        Opening pOpening;
        if (pLastIsoRun.limit >= bd.openings.length) {  /* no available new entry */
            Opening[] saveOpenings = bd.openings;
            int count;
            try {
                count = bd.openings.length;
                bd.openings = new Opening[count * 2];
            } catch (Exception e) {
                throw new OutOfMemoryError("Failed to allocate memory for openings");
            }
            System.arraycopy(saveOpenings, 0, bd.openings, 0, count);
        }
        pOpening = bd.openings[pLastIsoRun.limit];
        if (pOpening == null)
            pOpening = bd.openings[pLastIsoRun.limit]= new Opening();
        pOpening.position = position;
        pOpening.match = match;
        pOpening.contextDir = pLastIsoRun.contextDir;
        pOpening.contextPos = pLastIsoRun.contextPos;
        pOpening.flags = 0;
        pLastIsoRun.limit++;
    }
698017
function Id(bracket, round, match) {
  if (!(this instanceof Id)) {
    return new Id(bracket, round, match);
  }
  this.s = bracket;
  this.r = round;
  this.m = match;
}
1310968
public function addNewLineAfterOpeningParentheses()
    {
        if (false === $this->parentheses->getInlineParentheses()) {
            $this->indentation->setIncreaseBlockIndent(true);
            $this->newline = true;
        }
    }
182043
def create_entries
      seen = Set.new
      Looksee.adapter.lookup_modules(object).map do |mod|
        entry = Entry.new(mod, seen)
        seen += entry.methods.keys
        entry
      end
    end
30990
function openFileClicked() {
  var inputElement = document.createElement('input');
  inputElement['type'] = 'file';
  inputElement['multiple'] = true;
  inputElement['accept'] = [
    '.wtf-trace,application/x-extension-wtf-trace',
    '.wtf-json,application/x-extension-wtf-json',
    '.wtf-calls,application/x-extension-wtf-calls',
    '.cpuprofile,application/x-extension-cpuprofile',
    '.part,application/x-extension-part'
  ].join(',');
  inputElement.onchange = function(e) {
    _gaq.push(['_trackEvent', 'popup', 'open_file']);

    var fileEntries = [];
    for (var n = 0; n < inputElement.files.length; n++) {
      var file = inputElement.files[n];
      var blob = new Blob([file], {
        type: 'application/octet-stream'
      });
      var blobUrl = URL.createObjectURL(blob);
      fileEntries.push({
        name: file.name,
        url: blobUrl,
        size: blob.size
      });
    }

    port.postMessage({
      command: 'show_files',
      files: fileEntries
    });
    window.close();
  };
  inputElement.click();
}
915420
function enterNode(node) {
			var comments = this.sourceCode.getComments(node);

			emitCommentsEnter(this, comments.leading);
			this.original.enterNode(node);
			emitCommentsEnter(this, comments.trailing);
		}
154561
def add_entry(id, title, updated, link, options={})
      entries << {
        :id => id,
        :title => title,
        :updated => updated,
        :link => link
        }.merge(options)
    end
601621
function createEntryRequest(entry) {
    var xw = createXMLWriter(true);

    Object.keys(entry).forEach(function(key) {
        xw = xw.startElement('gsx:' + key)
            .text(util.coerceNumber(entry[key]).toString())
            .endElement();
    });

    return xw.endElement().toString();
}
369122
function(fileEntry) {
              var filename = fileObj.fileName.substring(0, fileObj.fileName.lastIndexOf('.'));
              var ext = fileObj.fileName.substring(fileObj.fileName.lastIndexOf('.'));
              var randomStr = randomString(); // if the file with fileName already exists, append the new filename with _randomStr ...
              fileObj.fileName = filename + '_' + randomStr + ext; // ... and file extension
              resolve({root:root, fileObj: fileObj});
            }
968311
def create(name, url, tournament_type="single elimination", **params):
    """"""
    params.update({
        "name": name,
        "url": url,
        "tournament_type": tournament_type,
    })

    return api.fetch_and_parse("POST", "tournaments", "tournament", **params)
316533
function createDb(config, dbUser, dbUserPass, dbName, cb) {
  log.logger.trace({user: dbUser, pwd: dbUserPass, name: dbName}, 'creating new datatbase');
  var url = config.mongoUrl;
  var admin = config.mongo.admin_auth.user;
  var admin_pass = config.mongo.admin_auth.pass;

  MongoClient.connect(url, function(err, db){
    if (err) return handleError(null, err, 'cannot open mongodb connection', cb);

    var targetDb = db.db(dbName);
    targetDb.authenticate(admin, admin_pass, {'authSource': 'admin'}, function(err) {
      if (err) return handleError(db, err, 'can not authenticate admin user', cb);

      // update for mongodb3.2 - need to remove user first
      targetDb.removeUser(dbUser, function(err) {
        if(err){
          log.logger.error(err, 'failed to remove user');
        }
        // add user to database
        targetDb.addUser(dbUser, dbUserPass, function(err, user) {
          if (err) return handleError(db, err, 'can not add user', cb);
          log.logger.trace({user: user, database: dbName}, 'mongo added new user');
          db.close();
          return cb();
        });
      });
    });
  });
}
501872
function(entry) {
        if (entry) {
            if (successCallback) {
                // create appropriate Entry object
                var fsName = entry.filesystemName || (entry.filesystem == window.PERSISTENT ? 'persistent' : 'temporary');
                fileSystems.getFs(fsName, function(fs) {
                    var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
                    successCallback(result);
                });
            }
        }
        else {
            // no Entry object returned
            fail(FileError.NOT_FOUND_ERR);
        }
    }
698792
function (cb, scope) {
            var es = this.__entrySet(), l = es.length, f = cb.bind(scope || this);
            es.forEach.apply(es, arguments);
        }
294719
function(oEntry) {
			var oResponse;
			var fnGrep = function(aContains, aContained) {
				return aContains.filter(function(x) {
					return aContained.indexOf(x) < 0;
				})[0];
			};
			// navigate to draft nodes and activate nodes
			for (var i = 0; i < this._oDraftMetadata.draftNodes.length; i++) {
				for (var navprop in this._mEntitySets[this._oDraftMetadata.draftRootName].navprops) {
					if (this._mEntitySets[this._oDraftMetadata.draftRootName].navprops[navprop].to.entitySet === this._oDraftMetadata.draftNodes[i]) {
						oResponse = jQuery.sap.sjax({
							url: oEntry[navprop].__deferred.uri,
							dataType: "json"
						});
						if (oResponse.success && oResponse.data && oResponse.data.d && oResponse.data.d.results) {
							var oNode;
							for (var j = 0; j < oResponse.data.d.results.length; j++) {
								oNode = oResponse.data.d.results[j];
								oNode.IsActiveEntity = true;
								oNode.HasActiveEntity = false;
								oNode.HasDraftEntity = false;
								oNode[this._oDraftMetadata.draftRootKey] = this._oConstants.EMPTY_GUID;
								var aSemanticDraftNodeKeys = this._calcSemanticKeys(this._oDraftMetadata.draftNodes[i], this._mEntitySets);
								var sDraftKey = fnGrep(this._mEntitySets[this._oDraftMetadata.draftNodes[i]].keys, aSemanticDraftNodeKeys);
								oNode[sDraftKey] = this._oConstants.EMPTY_GUID;
								jQuery.sap.sjax({
									url: oNode.__metadata.uri,
									type: "PATCH",
									data: JSON.stringify(oNode)
								});
							}
						}
					}
				}
			}
			oEntry.IsActiveEntity = true;
			oEntry.HasActiveEntity = false;
			oEntry.HasDraftEntity = false;
			oEntry[this._oDraftMetadata.draftRootKey] = this._oConstants.EMPTY_GUID;
			jQuery.sap.sjax({
				url: oEntry.__metadata.uri,
				type: "PATCH",
				data: JSON.stringify(oEntry)
			});
			return oEntry;
		}
1141582
function createOpenTag (tagName, attrs) {
  var attrString = Object.keys(attrs).map(function (key) {
    return ' ' + key + '="' + attrs[key] + '"';
  }).join('');

  return '<' + tagName + attrString + '>';
}
790147
function createEntryFacade(entry) {
    if (entry instanceof Entry !== true) {
        throw new Error("Failed creating entry facade: Provided item is not an Entry");
    }
    const facadeType = getEntryFacadeType(entry);
    const createFields = facadeFieldFactories[facadeType];
    if (!createFields) {
        throw new Error(`Failed creating entry facade: No factory found for type "${facadeType}"`);
    }
    const fields = createFields(entry);
    return {
        type: facadeType,
        fields: addExtraFieldsNonDestructive(entry, fields)
    };
}
822014
function createWindow() {
        // Create the browser window.

        // Get full path of the file getting opened
        const target = splitArgs(argv);
        if (target === '' && opts.defaultPath) {
            // Invalid, empty target, let's just create a window from default
            wm.createWindow(opts.defaultPath);
            return;
        }
        const targetPath = pathlib.resolve(process.cwd(), target);

        if (opts.changeDirectory === true) {
            // If we need to change into the relevant directory, do it now
            const dir = pathlib.dirname(targetPath);
            if (fs.existsSync(dir)) {
                process.chdir(dir);
            }
        } else if (String.isString(opts.changeDirectory)) {
            process.chdir(opts.changeDirectory);
        }
        wm.createWindow(targetPath);
    }