initialize consumer for simulation
        :param num_of_paths: number of path
        :type num_of_paths: int
        :param grid: list of grid point
        :type grid: list(date)
        :param seed: simulation seed
        :type seed: hashable
10896
def initialize(self, grid=None, num_of_paths=None, seed=None):
        
        self.num_of_paths = num_of_paths
        self.grid = grid
        self.seed = seed
        self.result = list()
        self.state = self.initial_state
1254060
private void init() throws IOException {
        if (initialized.compareAndSet(false, true)) {
            log.debug("Init: {}", mode);
            // instance an executor for queue handling
            scheduledExecutorService = Executors.newScheduledThreadPool(schedulerThreadSize, new CustomizableThreadFactory("FileConsumerExecutor-"));
            // if the path is null, the consumer has been uninitialized
            if (path != null) {
                if (log.isDebugEnabled()) {
                    Path parent = path.getParent();
                    log.debug("Parent abs: {} dir: {}", parent.isAbsolute(), Files.isDirectory(parent));
                }
                if (IClientStream.MODE_APPEND.equals(mode)) {
                    if (Files.notExists(path)) {
                        throw new IOException("File to be appended doesnt exist, verify the record mode");
                    }
                    log.debug("Path: {}\nRead: {} write: {} size: {}", path, Files.isReadable(path), Files.isWritable(path), Files.size(path));
                    writer = new FLVWriter(path, true);
                } else if (IClientStream.MODE_RECORD.equals(mode)) {
                    try {
                        // delete existing file
                        if (Files.deleteIfExists(path)) {
                            log.debug("File deleted");
                        }
                        // ensure parent dirs exist
                        Files.createDirectories(path.getParent());
                        // create the file
                        path = Files.createFile(path);
                    } catch (IOException ioe) {
                        log.error("File creation error: {}", ioe);
                    }
                    if (!Files.isWritable(path)) {
                        throw new IOException("File is not writable");
                    }
                    log.debug("Path: {}\nRead: {} write: {}", path, Files.isReadable(path), Files.isWritable(path));
                    writer = new FLVWriter(path, false);
                    if (audioConfigurationTag != null) {
                        writer.writeTag(audioConfigurationTag);
                    }
                    if (videoConfigurationTag != null) {
                        writer.writeTag(videoConfigurationTag);
                        gotVideoKeyframe = true;
                    }
                } else {
                    //throw new IllegalStateException(String.format("Illegal mode type: %s", mode));
                    try {
                        // delete existing file since we're not recording nor appending
                        if (Files.deleteIfExists(path)) {
                            log.debug("File deleted");
                        }
                    } catch (IOException ioe) {
                        log.error("File creation error: {}", ioe);
                    }
                }
            } else {
                log.warn("Consumer is uninitialized");
            }
            log.debug("Init - complete");
        }
    }
326266
def initialize(self, *args):
        
        # number of observed users
        self.n_user = 0

        # store user data
        self.users = {}

        # number of observed items
        self.n_item = 0

        # store item data
        self.items = {}
468482
def initGrid(self):
        
        blinker = [(4, 4), (4, 5), (4, 6)]
        toad = [(9, 5), (9, 6), (9, 7), (10, 4), (10, 5), (10, 6)]
        glider = [(4, 11), (5, 12), (6, 10), (6, 11), (6, 12)]
        r_pentomino = [(10, 60), (9, 61), (10, 61), (11, 61), (9, 62)]

        self.grid = {}

        if self.test:
            for cell in chain(blinker, toad, glider, r_pentomino):
                self.grid[cell] = 1
        else:
            for _ in range(self.initsize):
                ry = random.randint(self.y_pad, self.y_grid - 1)
                rx = random.randint(self.x_pad, self.x_grid - 1)
                self.grid[(ry, rx)] = 1
153892
def _run_path(self, path_num):
        
        # pre processing
        self.producer.initialize_path(path_num)
        self.consumer.initialize_path(path_num)

        # processing
        for new_date in self.grid:
            state = self.producer.evolve(new_date)
            self.consumer.consume(state)

        # post processing
        self.consumer.finalize_path(path_num)
915501
def initialize(self, seed=None):
        
        self.seed = seed or os.urandom(32)  # Generate new seed if not provided
        signing_key = SigningKey(self.seed)
        verifying_key = signing_key.get_verifying_key()
        self._auth_private = signing_key.to_seed()
        self._auth_public = verifying_key.to_bytes()
        log_binary(_LOGGER,
                   'Authentication keys',
                   Private=self._auth_private,
                   Public=self._auth_public)
502580
protected void initNextPath (long initStamp, long tickStamp)
    {
        if (_paths.size() == 0) {
            _pable.pathCompleted(tickStamp);

        } else {
            _curPath = _paths.remove(0);
            _lastInit = initStamp;

            _curPath.init(_pableRep, initStamp);
            _curPath.tick(_pableRep, tickStamp);
        }
    }
1285601
def map_init(interface, params):
    """"""
    import numpy as np
    import random
    np.random.seed(params['seed'])
    random.seed(params['seed'])
    return params
133472
def instantiate(self, parallel_envs, seed=0, preset='default') -> VecEnv:
        
        envs = DummyVecEnv([self._creation_function(i, seed, preset) for i in range(parallel_envs)])

        if self.frame_history is not None:
            envs = VecFrameStack(envs, self.frame_history)

        return envs
772482
def initialize_path(self, path_num=None):
        
        self.state = copy(self.initial_state)
        self.state.path = path_num
        self.random.seed(hash(self.seed) + hash(path_num))
486393
def _init(self):
        
        assert self._name
        assert self._group

        # self.n = 0
        self.u = []
        self.name = []
        self.idx = []
        self.uid = {}

        if not self._unamey:
            self._unamey = self._algebs
        else:
            assert len(self._unamey) == len(self._algebs)

        if not self._unamex:
            self._unamex = self._states
        else:
            assert len(self._unamex) == len(self._states)

        for item in self._data.keys():
            self.__dict__[item] = []

        for bus in self._ac.keys():
            for var in self._ac[bus]:
                self.__dict__[var] = []
        for node in self._dc.keys():
            for var in self._dc[node]:
                self.__dict__[var] = []

        for var in self._states + self._algebs + self._service:
            self.__dict__[var] = []

        self._flags['sysbase'] = False
        self._flags['allocate'] = False
        self._flags['address'] = False
207233
def _initialize_distance_grid(self):
        """"""
        p = [self._grid_distance(i) for i in range(self.num_neurons)]
        return np.array(p)
862174
def initialize(
            self, M_c, M_r, T, seed, initialization=b'from_the_prior',
            row_initialization=-1, n_chains=1,
            ROW_CRP_ALPHA_GRID=(), COLUMN_CRP_ALPHA_GRID=(),
            S_GRID=(), MU_GRID=(), N_GRID=31,):
        
        # FIXME: why is M_r passed?
        arg_tuples = self.get_initialize_arg_tuples(
            M_c, M_r, T, initialization, row_initialization, n_chains,
            ROW_CRP_ALPHA_GRID, COLUMN_CRP_ALPHA_GRID, S_GRID, MU_GRID, N_GRID,
            make_get_next_seed(seed),)

        chain_tuples = self.mapper(self.do_initialize, arg_tuples)
        X_L_list, X_D_list = zip(*chain_tuples)
        if n_chains == 1:
            X_L_list, X_D_list = X_L_list[0], X_D_list[0]

        return X_L_list, X_D_list
948857
@Override
	public void initialize(Collection<Instance> trainingPoints)
	{
		Iterator<Instance> trgPtsIterator = trainingPoints.iterator();
		
		if(trgPtsIterator.hasNext() && this.reset)
		{
			Instance inst = (Instance)trgPtsIterator.next();
			this.numAttributes = inst.numAttributes()-1;
			this.initializeNetwork();
		}
		
		while(trgPtsIterator.hasNext())
		{
			this.trainOnInstance((Instance)trgPtsIterator.next());			
		}
	}
1228671
def initialize(self, params, repetition):
    
    self.name = params["name"]
    self.dataDir = params.get("datadir", "data")
    self.seed = params.get("seed", 42) + repetition

    torch.manual_seed(self.seed)
    np.random.seed(self.seed)
    random.seed(self.seed)

    # Training
    self.epochs = params.get("epochs", 1)
    self.batch_size = params.get("batch_size", 128)
    self.batches_in_epoch = params.get("batches_in_epoch", 100000)
    self.first_epoch_batch_size = params.get("first_epoch_batch_size",
                                             self.batch_size)
    self.batches_in_first_epoch = params.get("batches_in_first_epoch",
                                             self.batches_in_epoch)

    # Testing
    self.test_batch_size = params.get("test_batch_size", 1000)
    self.test_batches_in_epoch = params.get("test_batches_in_epoch", 100000)
    self.noise_values = map(float,
                            params.get("noise_values", "0.0, 0.1").split(", "))
    self.best_noise_score = 0.0
    self.best_epoch = -1

    # Optimizer
    self.optimizer_class = eval(params.get("optimizer", "torch.optim.SGD"))
    self.lr = params.get("learning_rate", 0.05)
    self.momentum = params.get("momentum", 0.9)
    self.weight_decay = params.get("weight_decay", 0.0)
    self.optimizer_params = eval(params.get("optimizer_params", "{}"))
    self.lr_scheduler_gamma = params.get("lr_scheduler_gamma", 0.9)
    self.loss_function = eval(params.get("loss_function",
                                         "torch.nn.functional.cross_entropy"))

    # Network parameters
    self.conv1_sparsity = params.get("conv1_sparsity", 1.0)
    self.network_type = params.get("network_type", "sparse")
    self.growth_rate = params.get("growth_rate", 12)
    self.nblocks = map(int,
                       params.get("nblocks", "6, 12, 24, 16").split(", "))
    self.k_inference_factor = params.get("k_inference_factor", 1.5)

    self.dense_sparsities = map(float,
                                params.get("dense_sparsities",
                                           "1.0, 1.0, 1.0, 1.0").split(", "))
    self.transition_sparsities = map(float,
                                     params.get("transition_sparsities",
                                                "0.1, 0.1, 0.2").split(", "))
    self.linear_sparsity = params.get("linear_sparsity", 0.0)
    self.linear_weight_sparsity = params.get("linear_weight_sparsity", 0.3)
    self.linear_n = params.get("linear_n", 500)
    self.avg_pool_size = params.get("avg_pool_size", 2)
    self.dense_c1_out_planes = params.get("dense_c1_out_planes", 4*self.growth_rate)
726323
def initialize_autoloaded_paths(mods = ObjectSpace.each_object(Module)) # &do_autoload_block
      mods.each do |mod|
        # Module's constants are shared with Object. But if you set autoloads directly on Module, they
        # appear on multiple classes. So just skip, Object will take care of those.
        next if mod == Module
        # This happens with JRuby
        next unless mod.respond_to?(:constants)

        if mod.frozen?
          if mod.constants.any? { |name| mod.autoload?(name) }
            self.class.warn_frozen_module(mod)
          end
          next
        end

        mod.constants.each do |name|
          # JRuby can talk about deprecated constants here
          path = Tools.silence_warnings do
            mod.autoload?(name)
          end
          next unless path
          interceptor_path = setup_interceptor_for(mod, name, path)
          yield mod, name, interceptor_path
        end
      end
    end
760785
public void initializeGrid(double value) {
        for (int i = 0; i < grid.length; i++) {
            for (int j = 0; j < grid[0].length; j++) {
                for (int k = 0; k < grid[0][0].length; k++) {
                    grid[k][j][i] = value;
                }
            }
        }
    }