daoinput keys:
	    migration_request_id
679
def execute(self, conn, daoinput, transaction = False):
        
        if not conn:
	    dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationRequests/Remove. Expects db connection from upper layer.",
                                self.logger.exception)
        daoinput['create_by'] = dbsUtils().getCreateBy()
	try:
            msg = "DBSMigration: Invalid request. Sucessfully processed or processing requests cannot be removed,\
                    or the requested migration did not exist, or the requestor for removing and creating has to be the same user. "
            checkit = self.dbi.processData(self.select, daoinput, conn, transaction)
            if self.formatDict(checkit)[0]["count"] >= 1:
		reqID = {'migration_rqst_id':daoinput['migration_rqst_id']}
	        result = self.dbi.processData(self.sql, reqID, conn, transaction)
            else:
                dbsExceptionHandler('dbsException-invalid-input', msg, self.logger.exception)
	except:
            raise
277262
def change_access_key(self):
        """"""
        method = 'POST'
        endpoint = '/rest/v1/users/{}/accesskey/change'.format(
            self.client.sauce_username)
        return self.client.request(method, endpoint)
1154116
def migrate(cls, resource, datacenter_id, background=False):
        
        disk_id = cls.usable_id(resource)
        result = cls.call('hosting.disk.migrate', disk_id, datacenter_id)

        if background:
            return result

        cls.echo('Disk migration in progress.')
        cls.display_progress(result)
        return result
987900
public function init()
    {
        $select = new QueryBuilder();

        $select
            ->query("CREATE TABLE IF NOT EXISTS {$this->table} (id int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, param VARCHAR(250) NOT NULL, value VARCHAR(250) NOT NULL)")
            ->execute();

        $migrateVersion = $select
            ->query("SELECT value FROM {$this->table} WHERE param = 'migration_version'")
            ->fetchRow();

        if (isset($migrateVersion['value'])) {
            echo Utils::colorize("Migration tool is already initialized", "NOTE");
        } else {
            $select
                ->query("INSERT into {$this->table} (param, value) VALUES ('migration_version', 0)")
                ->execute();
            echo Utils::colorize("Initialization successful.", "SUCCESS");
        }
    }
879987
def migrate_to_multiple_pub_keys()
      all_pub_keys = users_public_keys()
      base_path    = @configuration.keydir_path

      puts "Starting migration of PUB keys from old format to new! (This can take a while)"
      all_pub_keys.each do |pub_key_path|
        # skip git pub or already migrated key
        unless pub_key_path.match(/.*git.pub$/) || pub_key_path.include?('@')
          file_name = extract_file_name(pub_key_path,base_path,:pub)
          pub_content = gitolite_admin_repo().file_content(pub_key_path)

          # delete_user
          remove_file(pub_key_path, "Migrating user ('#{file_name}') to new annotation, temporary removing user")

          # create user
          create_user_depracated(file_name, pub_content)
        end
      end
      puts "End migration of pub keys"
      require 'pp'
      pp users_public_keys
      puts "--------------- END ---------------"
    end
331697
public void migrate(Log log, String encoding) {

        createSchemaVersionTable();

        final Collection<Migration> pendingMigrations = getPendingMigrations();

        if (pendingMigrations.isEmpty()) {
            log.info("No new migrations are found");
            return;
        }
        log.info("Migrating database, applying " + pendingMigrations.size() + " migration(s)");
        Migration currentMigration = null;

        try {
            connection().setAutoCommit(false);
            for (Migration migration : pendingMigrations) {
                currentMigration = migration;
                log.info("Running migration " + currentMigration.getName());
                long start = System.currentTimeMillis();

                currentMigration.migrate(encoding);
                versionStrategy.recordMigration(currentMigration.getVersion(), new Date(start), (start - System.currentTimeMillis()));
                connection().commit();
            }
        } catch (Exception e) {
            try{connection().rollback();}catch(Exception ex){throw new MigrationException(e);}
            assert currentMigration != null;
            throw new MigrationException("Migration for version " + currentMigration.getVersion() + " failed, rolling back and terminating migration.", e);
        }
        log.info("Migrated database");
    }
1276406
public SchemaMigrator addMigration(String id, SchemaMigration migration) {
        descriptors.add(new SchemaMigrationDescriptor(id, descriptors.size(), migration));
        return this;
    }
561222
function requestIdMiddleware (req, res, next) {
    // get unique id object
    var uniqueId = randomUniqueId()
    // add data to req
    req.requestId = uniqueId.id
    req.requestCreateTime = uniqueId.timestamp
    // continue
    next()
}
996030
def upload_identity_keys(self):
        
        device_keys = {
            'user_id': self.user_id,
            'device_id': self.device_id,
            'algorithms': self._algorithms,
            'keys': {'{}:{}'.format(alg, self.device_id): key
                     for alg, key in self.identity_keys.items()}
        }
        self.sign_json(device_keys)
        ret = self.api.upload_keys(device_keys=device_keys)
        self.one_time_keys_manager.server_counts = ret['one_time_key_counts']
        logger.info('Uploaded identity keys.')
958289
def _write_migration(self, creator, name, table, create, path):
        
        file_ = os.path.basename(creator.create(name, path, table, create))

        return file_
701167
protected function getSchemaDownCreateBlueprint(MigrationInput $input)
    {
        $stub = $this->getStubContent('migration-schema-down', $input->template);

        $this->replaceConnectionName($stub, $input->connectionName)
            ->replaceTableName($stub, $this->tableName);

        return $stub;
    }
134831
def migrate_secret_key(old_key):
    """"""
    if 'SECRET_KEY' not in current_app.config or \
            current_app.config['SECRET_KEY'] is None:
        raise click.ClickException(
            'SECRET_KEY is not set in the configuration.')

    for ep in iter_entry_points('invenio_base.secret_key'):
        try:
            ep.load()(old_key=old_key)
        except Exception:
            current_app.logger.error(
                'Failed to initialize entry point: {0}'.format(ep))
            raise
    click.secho('Successfully changed secret key.', fg='green')
677287
protected function makeCreateMigration(MigrationInput $input, MigrationCapsule $migration)
    {
        $stub = $this->getStubContent('migration', $input->template);

        $blueprint = $this->getCreateTableBlueprint($migration->resource, $input);

        $this->replaceSchemaUp($stub, $this->getSchemaUpCreateCommand($input, $blueprint, 'create'))
            ->replaceSchemaDown($stub, $this->getSchemaDownCreateBlueprint($input))
            ->replaceMigationClassName($stub, $migration->className)
            ->createFile($migration->path, $stub)
            ->info('A migration was crafted successfully.');
    }
69558
function expectAliQueryKeys() {
    // can't query keys before bob has uploaded them
    expect(bobTestClient.deviceKeys).toBeTruthy();

    const bobKeys = {};
    bobKeys[bobDeviceId] = bobTestClient.deviceKeys;
    aliTestClient.httpBackend.when("POST", "/keys/query")
            .respond(200, function(path, content) {
        expect(content.device_keys[bobUserId]).toEqual(
            {},
            "Expected Alice to key query for " + bobUserId + ", got " +
            Object.keys(content.device_keys),
        );
        const result = {};
        result[bobUserId] = bobKeys;
        return {device_keys: result};
    });
    return aliTestClient.httpBackend.flush("/keys/query", 1);
}
1306954
private function formDoctrineInput($command, $migrationPath, $dbFilePath)
    {
        $input = new ArrayInput([
            '--configuration' => $migrationPath,
            '--db-configuration' => $dbFilePath,
            '-n' => true,
            'command' => $command
        ]);
        return $input;
    }
1251850
private void onSetTableId(CfDef cfDef, Properties cfProperties, StringBuilder builder)
    {
        String id = cfProperties.getProperty(CassandraConstants.ID);
        if (id != null)
        {
            try
            {
                if (builder != null)
                {
                    // TODO::::not available with composite key?
                }
                else
                {
                    cfDef.setId(Integer.parseInt(id));
                }
            }
            catch (NumberFormatException nfe)
            {
                log.error("Id should be numeric type, Caused by: ", nfe);
                throw new SchemaGenerationException(nfe);
            }
        }
    }
689500
function SqCmd(sequelize, options, logger) {

	console.log('DEPRECATED: Note sequelize-cmd has been deprecated due to change in sequelize core. Please consider using Umzug: https://github.com/sequelize/umzug')

    var self = this,
        defaults, config, dbConf, migConf, cmds, validCommands;

    defaults = {
        integrated: false,                  // FUTURE: when true do not run commands only return instance.
        templates: p.join(__dirname, '/assets'), // root path for migration.js, model.js, seed.js and sqcmd.json
        db: {
            dialect: 'mysql',               // the dialect for Sequelize to connect to.
            host: 'localhost',              // server hostname or ip.
            port: 3306,                     // server port.
            username: 'root',               // authorized user.
            password: null                  // password or null.
        },
        migration: {
            migrations: '/migrations',     // location of migrations.
            models: '/models',             // location of models.
            seeds: '/seeds',               // location of seed files.
            filesFilter: /\.js$/,          // RegExp filter
            autoSeed: false,               // when true seeding will run after migrations. NOT TESTED.
            fileNames: undefined,          // file names converted to case (capitalize, lower, upper, camel, pascal, title, undefined).
            modelNames: 'capitalize',      // model names converted to case (capitalize, lower, upper, camel, pascal, title, undefined).
            typeVariable: 'types',         // the variable name for your datatypes.
            
            validAttributes: [
                'type',
                'allowNull',
                'defaultValue',
                'primaryKey',
                'unique',
                'comment',
                'get',
                'set',
                'validate',
                'values',
                'autoIncrement'
            ],

            excludeAttributes: [
                '_checkEnum'
            ],

            // the keys to include when parsing models for migration generation.
            validOptions: [
                'name',
                'indexes',
                'classMethods',
                'instanceMethods',
                'validate',
                'getterMethods',
                'setterMethods',
                'hooks',
                'tableName',
                'omitNull',
                'freezeTableName',
                'paranoid',
                'underscored',
                'createdAt',
                'updatedAt',
                'deletedAt'
            ]
        }
    };

    cmds = {
        init: { alias: ['initialize'], event: self.init },
        addModel: { alias: ['createModel', 'newModel', 'generateModel'], event: self.addModel },
        addMigration: { alias: ['createMigration', 'newMigration', 'generateMigration'], event: self.addMigration },
        addSeed: { alias: ['createSeed', 'newSeed', 'generateSeed'], event: self.addSeed },
        migrate: { alias: [], event: self.migrate },
        seed: { alias: [], event: self.seed },
        load: { alias: ['import'], event: self.import },
        find: { alias: ['lookup'], event: self.find },
        usage: { alias: [], event: self.usage }
    };

    // if a custom logger is passed
    // use it instead of the built in logger.
    // used only with API.
    // passes the log message and type ex: log('my message', 'info').
    // types are: 'info', 'warn', 'error', 'debug' (based on winston naming conventions).
    if(logger && _.isFunction(logger))
        log = logger;

    // add defaults for logs.
    defaults.db.logging = log;
    defaults.migration.logging = log;

    validCommands = _.functions(this);

    // apply context to helpers.
    helpers = utils.helpers.call(this, log);

    this.Sequelize = Sequelize;
    this.sequelize = sequelize || undefined;
    this.moment = moment;
    this.sqPath = sqPath;
    this.DataTypes = DataTypes;

    this.getMigrator = function getMigrator(force) {
       self.migConf.filesFilter = new RegExp(self.migConf.filesFilter);
        self.migConf.path = p.join(cwd, self.migConf.path);
        var Migrator = require('./migrator');
        Migrator = Migrator.call(self);

        if (force)
            self.migInstance = new Migrator(self.sequelize, self.migConf);
         else
            self.migInstance = self.migInstance || new Migrator(self.sequelize, self.migConf);
    }

    function lookupCmd(c) {
        var result;
        if(cmds[c]) return c;
        _.forEach(cmds, function (v,k) {
            if(result) return;
            if(_.contains(v.alias, c))
                result = k;
        });
        return result;
    }

    function runCmd() {
        cmds[self.cmd].event.call(self);
    }

    // if boolean is passed cli is calling.
    if(sequelize === true){
        cli = true;
        sequelize = undefined;
        options = undefined;
    }

    // check if command alias was used.
    this.cmd = lookupCmd(cmd);

    if(!_.contains(validCommands, this.cmd)) return;

    // if options are not specified
    // assume only options are passed
    // and no existing db connection is supplied.
    if(!options && !cli){
        options = sequelize;
        sequelize = undefined;
    }

    // get user config path.
    config = p.join(cwd, '/sqcmd.json');
    
    // check if config file exists.
    if(fs.existsSync(config)){
        config = helpers.tryParseJSON(utils.io.read(config));
        // get the config for the current environment.
        options = config[process.env.NODE_ENV  || 'development'] || {};
    } else {
        if(cli && !_.contains(['usage', 'init'], this.cmd))
           this.exit('Configuration file is required to use sequelize-cmd.\n      Use "sqcmd init" without quotes to initialize.', 'warn');
    }

    // merge the options.
    options = options || {};
    options.migration = options.migration || {};
    options.migration.path = options.migration.path || options.migration.migrations;
    options = _.merge(defaults, options);
    dbConf = _.extend(options.db, flags);
    migConf = _.extend(options.migration, flags);


    // we need to specify the path the dialect module in use.
    dbConf.dialectModulePath = dbConf.dialectModulePath || p.join(cwd, '/node_modules/' + dbConf.dialect);

    // check if custom logger is used for db if so use it.
    if(dbConf.logger)
        log = dbConf.logger;

    // set instance db object.
    this.sequelize = sequelize;
    this.dbConf = dbConf;
    this.migConf = migConf;
    this.templates = options.templates;
    this.migrations = {};
    this.models = {};

    // if init don't create db connection.
    if(_.contains(['init', 'usage'], this.cmd)){

        if(!cli && this.cmd === 'init')
            return this.exit('Sequelize-cmd does not expose "init" or "usage" commands when using the API.', 'warn');
        runCmd();

    } else {

        // if not cli and no db or config return error.
        if(!cli && !this.sequelize && (!dbConf.database || dbConf.database == 'undefined'))
            this.exit('Sequelize db connection not provided or invalid configuration file.', 'error');

        // if is cli and no db is specified return error.
        if(cli && !dbConf.database || dbConf.database == 'undefined')
            this.exit('Unable to continue using database: ' + dbConf.database, 'error');


        // if no database connection create one.
        // then get the migInstance.
        if(!this.sequelize) {

            this.sequelize = new Sequelize(dbConf.database, dbConf.username, dbConf.password, dbConf);
            this.sequelize
                .authenticate()
                .complete(function(err) {
                    if(err)
                        return self.exit(err.stack || err.message || 'Unknown error occurred.', 'error');
                    self.getMigrator();
                    Promise = self.sequelize.Utils.Promise;
                    // only run cmd if called from cli
                    if(cli)
                        runCmd();
                });

        } else {

            this.getMigrator();
            Promise = this.sequelize.Utils.Promise;

            // only run cmd if called from cli
            if(cli)
                runCmd();

        }

    }

    return this;
}