NPN_CHANGES_BEGIN
769170
void sendNextProtocol(NextProtoNego.Provider provider) throws IOException
    {
        if (isInitialHandshake && provider != null)
        {
            if (protocols == null)
            {
                if (NextProtoNego.debug)
                    System.err.println(new StringBuilder("[C] NPN not received for ").append(conn != null ? conn : engine));
                ((NextProtoNego.ClientProvider)provider).unsupported();
            }
            else
            {
                try
                {
                    String protocol = ((NextProtoNego.ClientProvider)provider).selectProtocol(protocols);
                    if (NextProtoNego.debug)
                        System.err.println(new StringBuilder("[C] NPN selected '").append(protocol).append("' for ").append(conn != null ? conn : engine));
                    new NextProtocolMessage(protocol).write(output);
                    output.flush();
                }
                catch(Throwable t)
                {
                    fatalSE(Alerts.alert_handshake_failure, "NPN protocol selection failure", t);
                }
            }
        }
    }
192580
public void startMonitor() {
        logger.info("Starting Directory Update Monitor");
        try {
            monitor.start();
        } catch (IllegalStateException e) {
            logger.info("File alteration monitor is already started: " + e.getMessage());
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
486770
function (nodes, done) {
      self.changes = nodes.reduce(maxChange, self.changes)
      done(null, nodes)
    }
1087166
function initializePackageChangelog( $package, $http, $step, &$persistentData, $tpl )
    {
        $user = eZUser::currentUser();
        $userObject = $user->attribute( 'contentobject' );
        if ( $userObject )
            $changelogPerson = $userObject->attribute( 'name' );
        $changelogEmail = $user->attribute( 'email' );
        $changelogText = '';

        $persistentData['changelog_person'] = $changelogPerson;
        $persistentData['changelog_email'] = $changelogEmail;
        if ( !( $package instanceof eZPackage ) )
        {
            $changelogText = $this->initialChangelogEntry( $package, $http, $step, $persistentData, $tpl );
        }
        $persistentData['changelog_text'] = $changelogText;
        $persistentData['changelog_entries'] = array();
    }
605483
function begin(name, bypass) {
        _currentOperation = _getBase(name);
        if (bypass === true) {
            _currentOperation.bypass = true;
        }
    }
891788
function changes() {
  const version   = require('./package.json').version;
  const changelog = File.readFileSync('CHANGELOG.md', 'utf-8');
  const match     = changelog.match(/^## Version (.*) .*\n([\S\s]+?)\n##/m);

  assert(match, 'CHANGELOG.md missing entry: ## Version ' + version);
  assert.equal(match[1], version, 'CHANGELOG.md missing entry for version ' + version);

  const changes   = match[2].trim();
  assert(changes, 'CHANGELOG.md empty entry for version ' + version);
  File.writeFileSync('.changes', changes);
}
154718
function (args, callback) {
        if (ternserver) {
          ternserver.request({
              query: {
                type: "rename",  //$NON-NLS-1$
                file: args.meta.location,
                end: args.params.offset,
                newName: args.newname
              },
              files: args.files
            },
            function (error, changes) {
              if (error) {
                callback({
                  request: 'rename',
                  error: typeof error === 'string' ? error : error.message,
                  message: Messages['failedRenameTern']
                }); //$NON-NLS-1$
              } else if (changes && Array.isArray(changes.changes)) {
                callback({request: 'rename', changes: changes}); //$NON-NLS-1$
              } else {
                callback({request: 'rename', changes: []}); //$NON-NLS-1$
              }
            });
        } else {
          callback({request: 'rename', message: Messages['failedRenameNoServer']}); //$NON-NLS-1$
        }
      }
292951
protected void start() {
        if (mNumInstances == 0) {
            if (mListeners != null && mListeners.size() > 0) {
                ArrayList<TransitionListener> tmpListeners =
                        (ArrayList<TransitionListener>) mListeners.clone();
                int numListeners = tmpListeners.size();
                for (int i = 0; i < numListeners; ++i) {
                    tmpListeners.get(i).onTransitionStart(this);
                }
            }
            mEnded = false;
        }
        mNumInstances++;
    }
1105234
def _log_changes(ret, changekey, changevalue):
    '''
    
    '''
    cl = ret['changes'].get('new', [])
    cl.append({changekey: _object_reducer(changevalue)})
    ret['changes']['new'] = cl
    return ret
609842
function onServicesChanged(changes,removed) {
  var self = this;
  
  self.emit('servicesChanged',changes,removed);
  var numNew = 0;
  for(var key in changes) {
    if(Object.keys(changes[key]).length > 0) { // not empty
      numNew++;
    }
  }
  //debug("ServicesChanged: added: "+numNew+" removed: "+Object.keys(removed).length);
  // Future: emit per removed network a networkRemoved event
  // Future: emit per added network a networkAdded event
  this.iface.getServices(function(err,services) {
    self._setServices.call(self,Parser.parseServices(services),false);
    updateCurrentService.call(self); 
  });
}
992359
def on_train_begin(self, **kwargs:Any)->None:
        ""
        #Get a copy of the model params in FP32
        self.model_params, self.master_params = get_master(self.learn.layer_groups, self.flat_master)
        #Changes the optimizer so that the optimization step is done in FP32.
        new_opt = self.learn.opt.new_with_params(self.master_params)
        if self.opt is not None:
            self.opt.lr,self.opt.wd = self.learn.opt.lr,self.learn.opt.wd
            new_opt.load_state_dict(self.opt)
        self.learn.opt.opt = new_opt.opt
        self.noskip = 0
1261709
def p_start(self, p):
        ''''''
        p[0] = ast.Program(headers=p[1], definitions=p[2])
1277695
def change_by(cls, name, num):
        """"""
        count = cls.count(name)
        if count + num < 0:
            raise CounterValueError('Counter[%s] will be negative '
                                    'after %+d.' % (name, num))

        counter = cls.collection.find_and_modify(
            {'name': name},
            {'$inc': {'seq': num}},
            new=True,
            upsert=True
        )
        return counter['seq']
182729
def main(config_file):
    """"""

    if not (os.path.exists(config_file) and os.path.isfile(config_file)):
        msg = "Missing or invalid config file {0}".format(config_file)
        raise ValueError(msg)

    print("Loading config file {0}.".format(config_file))

    # Use the appropriate network driver to connect to the device:
    driver = napalm.get_network_driver("eos")

    # Connect:
    device = driver(
        hostname="127.0.0.1",
        username="vagrant",
        password="vagrant",
        optional_args={"port": 12443},
    )

    print("Opening ...")
    device.open()

    print("Loading replacement candidate ...")
    device.load_replace_candidate(filename=config_file)

    # Note that the changes have not been applied yet. Before applying
    # the configuration you can check the changes:
    print("\nDiff:")
    print(device.compare_config())

    # You can commit or discard the candidate changes.
    try:
        choice = raw_input("\nWould you like to commit these changes? [yN]: ")
    except NameError:
        choice = input("\nWould you like to commit these changes? [yN]: ")
    if choice == "y":
        print("Committing ...")
        device.commit_config()
    else:
        print("Discarding ...")
        device.discard_config()

    # close the session with the device.
    device.close()
    print("Done.")
517722
def changes(self, adding=None, deleting=None):
        """"""
        if deleting is not None:
            for deleted in deleting:
                self.root_node.remove(deleted)

        if adding is not None:
            for added in adding:
                self.root_node.add(added)

        added = list()
        removed = list()

        for csn in self._get_conflict_set_nodes():
            c_added, c_removed = csn.get_activations()
            added.extend(c_added)
            removed.extend(c_removed)

        return (added, removed)
1010085
function initNPM() {
    if (npmIsReady) return npmIsReady;

    npmIsReady = Promise.nfcall(npm.load, {
        silent: true,
        loglevel: 'silent'
    });

    return npmIsReady;
}
1068751
def postinit(self, args, body):
        
        self.args = args
        self.body = body