Init prg/chr/ram data.
969819
function() {
		this.prgBanks = this.header[4];
		this.chrBanks = this.header[5];
		this.ramBanks = this.header[8] || 1;

		this.prgSize = this.prgBanks * 16 * 1024;
		this.chrSize = this.chrBanks * 8 * 1024;
		this.ramSize = this.ramBanks * 8 * 1024;

		this.prgData = this.data.subarray( 0, this.prgSize );

		if ( this.chrBanks ) {
			this.chrData = this.data.subarray( this.prgSize, this.prgSize + this.chrSize );
		} else {
			// no CHR banks, but probably still CHR RAM
			this.chrData = new Uint8Array( 0x2000 );
		}

		this.ramData = new Uint8Array( this.ramSize );

		this.initMapper();
	}
710203
private static void initialize()
	{
		for (int i = 0; i < 256; ++i)
		{
			long crc = i;
			for (int j = 8; j > 0; j--)
			{
				if ((crc & 1) == 1)
					crc = (crc >>> 1) ^ polynomial;
				else
					crc >>>= 1;
			}
			values[i] = crc;
		}
		init_done = true;
	}
644482
public static function init()
    {

        // Initialize format drivers
        foreach (glob(implode(DIRECTORY_SEPARATOR, array(__DIR__,'Format','*.php'))) as $filename) {

            $filename = explode(DIRECTORY_SEPARATOR, $filename);
            $filename = explode('.',array_pop($filename));
            array_pop($filename);
            $filename = implode('.', $filename);

            if($filename == 'FormatInterface') continue;

            $className = explode("\\",__CLASS__);
            array_pop($className);
            array_push($className, 'Format');
            array_push($className, $filename);
            $className = implode('\\', $className);

            self::registerFormat($className);
        }

        // Initialize storage drivers
        foreach (glob(implode(DIRECTORY_SEPARATOR, array(__DIR__,'Storage','*.php'))) as $filename) {

            $filename = explode(DIRECTORY_SEPARATOR, $filename);
            $filename = explode('.',array_pop($filename));
            array_pop($filename);
            $filename = implode('.', $filename);

            if($filename == 'StorageInterface') continue;

            $className = explode("\\",__CLASS__);
            array_pop($className);
            array_push($className, 'Storage');
            array_push($className, $filename);
            $className = implode('\\', $className);

            self::registerStorage($className);
        }
    }
1065104
def init():
    ''''''
    # Load values from config file
    config_file = os.path.realpath(os.path.join(os.getcwd(), 'swaggery.ini'))
    config = configparser.RawConfigParser(allow_no_value=True)
    config.read(config_file)
    log_level = config.get('application', 'logging_level').upper()
    api_dirs = list(config['apis'])
    do_checks = config.get('application',
                           'disable_boot_checks').lower() == 'false'
    # Set logging level
    log.setLevel(getattr(logging, log_level))
    log.debug('Log level set to {}'.format(log_level))
    # Bootstrap application
    log.debug('Exploring directories: {}'.format(api_dirs))
    application = Swaggery(api_dirs=api_dirs, do_checks=do_checks)
    return application
1273679
public void init(Node segref, String path, char predelim0, char predelim1, StringBuffer res, Document document,
                     HashMap<String, String> predefs, HashMap<String, String> valids) {
        super.init(segref, path, predelim0, predelim1, res, document, predefs, valids);
    }
1279900
protected void init_stats() {
		byteCount = 0;
		ctrlWordCount = 0;
		openGroupCount = 0;
		closeGroupCount = 0;
		characterCount = 0;
		ctrlWordHandledCount = 0;
		ctrlWordNotHandledCount = 0;
		ctrlWordSkippedCount = 0;
		groupSkippedCount = 0;
	}
1249012
def _load_init(self, data, ctx):
        """"""
        if self.shape:
            for self_dim, data_dim in zip(self.shape, data.shape):
                assert self_dim in (0, data_dim), \
                    "Failed loading Parameter '%s' from saved params: " \
                    "shape incompatible expected %s vs saved %s"%(
                        self.name, str(self.shape), str(data.shape))
            self.shape = tuple(i if i != 0 else j for i, j in zip(self.shape, data.shape))
        if self.dtype:
            assert np.dtype(self.dtype).type == data.dtype, \
                "Failed loading Parameter '%s' from saved params: " \
                "dtype incompatible expected %s vs saved %s"%(
                    self.name, str(self.dtype), str(data.dtype))
        if self._stype != data.stype:
            data = data.tostype(self._stype)
        if isinstance(ctx, Context):
            ctx = [ctx]
        if self._data is None:
            if self._deferred_init:
                assert ctx is None or set(ctx) == set(self._deferred_init[1]), \
                    "Failed to load Parameter '%s' on %s because it was " \
                    "previous initialized on %s."%(
                        self.name, str(ctx), str(self.list_ctx()))
                ctx = self._deferred_init[1]
            elif ctx is None:
                ctx = [cpu()]
            self._init_impl(data, ctx)
        else:
            assert ctx is None or set(ctx) == set(self.list_ctx()), \
                "Failed to load Parameter '%s' on %s because it was " \
                "previous initialized on %s."%(
                    self.name, str(ctx), str(self.list_ctx()))
            self.set_data(data)
        self._deferred_init = ()
671782
def _init_setup_console_data(self, order: str = "C") -> None:
        """"""
        global _root_console
        self._key_color = None
        if self.console_c == ffi.NULL:
            _root_console = self
            self._console_data = lib.TCOD_ctx.root
        else:
            self._console_data = ffi.cast(
                "struct TCOD_Console*", self.console_c
            )

        self._tiles = np.frombuffer(
            ffi.buffer(self._console_data.tiles[0 : self.width * self.height]),
            dtype=self.DTYPE,
        ).reshape((self.height, self.width))

        self._order = tcod._internal.verify_order(order)
1254617
def OnInit(self):
        """"""

        # Get command line options and arguments
        cmdp = Commandlineparser()
        options, filename = cmdp.parse()

        kwargs = {
            "title": "pyspread",
            "S": self.S
        }

        # Store command line input in config if no file is provided
        if filename is None:
            kwargs["dimensions"] = options.dimensions

        # Main window creation
        from src.gui._main_window import MainWindow

        self.main_window = MainWindow(None, **kwargs)

        # Initialize file loading via event

        if gnupg is not None and options.new_gpgkey:
            # Create GPG key if not present

            try:
                from src.lib.gpg import genkey
                self.config["gpg_key_fingerprint"] = repr("")
                genkey()

            except ImportError:
                pass

            except ValueError:
                # python-gnupg is installed but gnupg is not installed
                pass

        # Show application window
        self.SetTopWindow(self.main_window)
        self.main_window.Show()

        # Load filename if provided
        if filename is not None:
            post_command_event(self.main_window, self.GridActionOpenMsg,
                               attr={"filepath": filename})
            self.main_window.filepath = filename

        return True
420643
def prg_rom(self):
        """"""
        try:
            return self.raw_data[self.prg_rom_start:self.prg_rom_stop]
        except IndexError:
            raise ValueError('failed to read PRG-ROM on ROM.')
112331
def init(scope, app, settings):
    """"""
    cfg = settings.get('rw.static', {})
    static = Static()
    scope['static'] = static
    scope['template_env'].globals['static'] = static
    for base_uri, sources in cfg.items():
        full_paths = []
        for source in sources:
            if isinstance(source, dict):
                full_path = source['path']
                full_paths.append(full_path.format(**os.environ))
                continue
            elif ',' in source:
                module_name, path = [part.strip()
                                     for part in source.split(',')]
            else:
                module_name = source
                path = 'static'
            full_path = pkg_resources.resource_filename(module_name, path)
            full_paths.append(full_path)

        app.root.mount('/' + base_uri + '/<h>/<path:path>',
                       StaticHandler, {'path': full_paths},
                       name='static_' + base_uri.replace('.', '_'))

        static.handlers.append((base_uri, StaticHandler, full_paths))
    static.setup()
532701
def _init(self):
        """"""
        for goid in self.godag.go_sources:
            goobj = self.godag.go2obj[goid]
            self.godag.go2obj[goid] = goobj
            # Traverse up parents
            if self.traverse_parent and goid not in self.seen_cids:
                self._traverse_parent_objs(goobj)
            # Traverse down children
            if self.traverse_child and goid not in self.seen_pids:
                self._traverse_child_objs(goobj)
105550
def initialize():
    
    for pin in sorted(OUTPUT_PINS.values()):
        _enable_pin(pin, OUT)

    for pin in sorted(INPUT_PINS.values()):
        _enable_pin(pin, IN)
122557
def __init_from_csr(self, csr, params_str, ref_dataset):
        """"""
        if len(csr.indices) != len(csr.data):
            raise ValueError('Length mismatch: {} vs {}'.format(len(csr.indices), len(csr.data)))
        self.handle = ctypes.c_void_p()

        ptr_indptr, type_ptr_indptr, __ = c_int_array(csr.indptr)
        ptr_data, type_ptr_data, _ = c_float_array(csr.data)

        assert csr.shape[1] <= MAX_INT32
        csr.indices = csr.indices.astype(np.int32, copy=False)

        _safe_call(_LIB.LGBM_DatasetCreateFromCSR(
            ptr_indptr,
            ctypes.c_int(type_ptr_indptr),
            csr.indices.ctypes.data_as(ctypes.POINTER(ctypes.c_int32)),
            ptr_data,
            ctypes.c_int(type_ptr_data),
            ctypes.c_int64(len(csr.indptr)),
            ctypes.c_int64(len(csr.data)),
            ctypes.c_int64(csr.shape[1]),
            c_str(params_str),
            ref_dataset,
            ctypes.byref(self.handle)))
        return self
333823
def _init():
    """"""
    import importlib
    import os
    import re

    filenames = os.listdir(os.path.dirname(__file__))

    module_names = set()
    for filename in filenames:
        match = re.match(r'^(?P<name>[A-Z_a-z]\w*)\.py[co]?$', filename)
        if match:
            module_names.add(match.group('name'))

    for module_name in module_names:
        try:
            module = importlib.import_module('.' + module_name, __name__)
        except ImportError:
            continue

        for name, member in module.__dict__.items():
            if not isinstance(member, type):
                # skip non-new-style classes
                continue
            if not issubclass(member, Engine):
                # skip non-subclasses of Engine
                continue
            if member is Engine:
                # skip "abstract" class Engine
                continue

            try:
                handle = member.handle
            except AttributeError:
                continue

            engines[handle] = member
219898
def Initialize(self):
    """"""
    super(AFF4MemoryStreamBase, self).Initialize()
    contents = b""

    if "r" in self.mode:
      contents = self.Get(self.Schema.CONTENT).AsBytes()
      try:
        if contents is not None:
          contents = zlib.decompress(contents)
      except zlib.error:
        pass

    self.fd = io.BytesIO(contents)
    self.size = len(contents)
    self.offset = 0
845396
def initCTR(self, iv=0):
        """"""
        assert struct.calcsize("Q") == self.blocksize()
        self.ctr_iv = iv
        self._calcCTRBUF()