Initialize the pipeline in maya so everything works

    Init environment and load plugins.
    This also creates the initial Jukebox Menu entry.

    :returns: None
    :rtype: None
    :raises: None
328480
def init():
    
    main.init_environment()
    pluginpath = os.pathsep.join((os.environ.get('JUKEBOX_PLUGIN_PATH', ''), BUILTIN_PLUGIN_PATH))
    os.environ['JUKEBOX_PLUGIN_PATH'] = pluginpath
    try:
        maya.standalone.initialize()
        jukeboxmaya.STANDALONE_INITIALIZED = True
    except RuntimeError as e:
        jukeboxmaya.STANDALONE_INITIALIZED = False
        if str(e) == "maya.standalone may only be used from an external Python interpreter":
            mm = MenuManager.get()
            mainmenu = mm.create_menu("Jukebox", tearOff=True)
            mm.create_menu("Help", parent=mainmenu, command=show_help)
    # load plugins
    pmanager = MayaPluginManager.get()
    pmanager.load_plugins()
    load_mayaplugins()
347672
def init2(
        self, 
        input_tube,      # Read task from the input tube.
        output_tubes,    # Send result on all the output tubes.
        num_workers,     # Total number of workers in the stage.
        disable_result,  # Whether to override any result with None.
        do_stop_task,    # Whether to call doTask() on "stop" request.
        ):
        """"""

        super(OrderedWorker, self).__init__()
        self._tube_task_input = input_tube
        self._tubes_result_output = output_tubes
        self._num_workers = num_workers

        # Serializes reading from input tube.
        self._lock_prev_input = None
        self._lock_next_input = None

        # Serializes writing to output tube.
        self._lock_prev_output = None
        self._lock_next_output = None

        self._disable_result = disable_result
        self._do_stop_task = do_stop_task
521059
def _initialize(self):
        
        meta = getattr(self, ModelBase._meta_attr)
        # read modelfile, convert JSON and load/update model
        if self.param_file is not None:
            self._load()
        LOGGER.debug('model:\n%r', self.model)
        # initialize layers
        # FIXME: move import inside loop for custom layers in different modules
        mod = importlib.import_module(meta.layers_mod, meta.layers_pkg)
        src_model = {}
        for layer, value in self.model.iteritems():
            # from layers module get the layer's class definition
            layer_cls = getattr(mod, meta.layer_cls_names[layer])  # class def
            self.layers[layer] = layer_cls  # add layer class def to model
            # check if model layers are classes
            src_value = {}  # layer value generated from source classes
            for src in value['sources']:
                # check if source has keyword arguments
                try:
                    src, kwargs = src
                except (TypeError, ValueError):
                    kwargs = {}  # no key work arguments
                # skip if not a source class
                if isinstance(src, basestring):
                    continue
                # generate layer value from source class
                src_value[src.__name__] = {'module': src.__module__,
                                           'package': None}
                # update layer keyword arguments
                src_value[src.__name__].update(kwargs)
            # use layer values generated from source class
            if src_value:
                value = src_model[layer] = src_value
            else:
                srcmod, srcpkg = value.get('module'), value.get('package')
                try:
                    value = dict(value['sources'])
                except ValueError:
                    value = dict.fromkeys(value['sources'], {})
                for src in value.viewkeys():
                    if srcmod is not None:
                        value[src]['module'] = srcmod
                    if srcpkg is not None:
                        value[src]['package'] = srcpkg
            # set layer attribute with model data
            setattr(self, layer, layer_cls(value))
        # update model with layer values generated from source classes
        if src_model:
            self.model.update(src_model)
        self._update()
        self._state = 'initialized'
127222
def _init_steps(self,):
        
        self._check_old_yaml_format()
        config_steps = self.flow_config.steps
        self._check_infinite_flows(config_steps)

        steps = []

        for number, step_config in config_steps.items():
            specs = self._visit_step(number, step_config)
            steps.extend(specs)

        return sorted(steps, key=attrgetter("step_num"))
539155
def _init(self, clnt):
        ''''''
        assert clnt, "clnt is None"
        self._clnt = clnt
        self._apikey = clnt.apikey()
        self._version = clnt.conf(YP_VERSION, defval=VERSION_V2)
        self._charset = clnt.conf(HTTP_CHARSET, defval=CHARSET_UTF8)
        self._name = self.__class__.__module__.split('.')[-1]
285049
def init(directory=None):
    """"""
    repo = repo_path(directory)
    if os.path.isdir(repo):
        raise RepositoryAlreadyExistsError(directory, repo)

    # Initialize repository with default template
    shutil.copytree(default_template_path, repo)

    message = '"Default presentation content."'
    subprocess.call(['git', 'init', '-q', repo])
    subprocess.call(['git', 'add', '.'], cwd=repo)
    subprocess.call(['git', 'commit', '-q', '-m', message], cwd=repo)

    return repo
605526
def initialize(self, init_value, context=None, force=False):
        

        if not force and self._instance is not None:
            raise ConfigurationAlreadyInitializedError(
                'Configuration manager object is already initialized.'
            )

        self.__class__._instance = Root(init_value, context=context)
1047769
def initialise():
    
    global settings, project_settings

    # Global changes settings
    settings = Changes.load()

    # Project specific settings
    project_settings = Project.load(GitHubRepository(auth_token=settings.auth_token))
1353594
def init(self):
        
        import subprocess
        import fcntl
        
        width = str(self.image_dimensions[0])
        height = str(self.image_dimensions[1])
        
        comlist = self.executable.split() + [width, height, self.tmpfile] # e.g. "python3", "example_process1.py", etc.
        
        try:
            self.p = subprocess.Popen(comlist, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
        except Exception as e:
            print(self.pre, "Could not open external process.  Failed with '"+str(e)+"'")
            return
        
        self.reset()
323647
def _load(self, ):
        
        super(JB_MayaPlugin, self)._load()
        try:
            if not jukeboxmaya.STANDALONE_INITIALIZED:
                self.init_ui()
        except Exception:
            log.exception("Load Ui failed!")
335120
def initialize_plugin(self):
        
        # Generate a list of blacklisted packages from the configuration and
        # store it into self.blacklist_package_names attribute so this
        # operation doesn't end up in the fastpath.
        if not self.blacklist_package_names:
            self.blacklist_package_names = self._determine_filtered_package_names()
            logger.info(
                f"Initialized project plugin {self.name}, filtering "
                + f"{self.blacklist_package_names}"
            )
497429
def main():
    
    config = build_config()

    parser = argparse.ArgumentParser(
        description="""
        Maya Launcher is a useful script that tries to deal with all
        important system environments maya uses when starting up.

        It aims to streamline the setup process of maya to a simple string
        instead of constantly having to make sure paths are setup correctly.
        """
    )

    parser.add_argument(
        'file',
        nargs='?',
        default=None,
        help="""
        file is an optional argument telling maya what file to open with
        the launcher.
        """)

    parser.add_argument(
        '-v', '--version',
        type=str,
        choices=get_executable_choices(dict(config.items(
                                            Config.EXECUTABLES))),
        help="""
        Launch Maya with given version.
        """)

    parser.add_argument(
        '-env', '--environment',
        metavar='env',
        type=str,
        default=config.get(Config.DEFAULTS, 'environment'),
        help="""
        Launch maya with given environemnt, if no environment is specified
        will try to use default value. If not default value is specified
        Maya will behave with factory environment setup.
        """)

    parser.add_argument(
        '-p', '--path',
        metavar='path',
        type=str,
        nargs='+',
        help="""
        Path is an optional argument that takes an unlimited number of paths
        to use for environment creation.

        Useful if you don't want to create a environment variable. Just
        pass the path you want to use.
        """)

    parser.add_argument(
        '-e', '--edit',
        action='store_true',
        help="""
        Edit config file.
        """)

    parser.add_argument(
        '-d', '--debug',
        action='store_true',
        help="""
        Start maya in dev mode, autoload on plugins are turned off.
        """)

    # Parse the arguments
    args = parser.parse_args()
    if args.edit:
        return config.edit()

    if args.debug:
        logger.setLevel(logging.DEBUG)

    # Get executable from either default value in config or given value.
    # If neither exists exit launcher.
    if args.version is None:
        exec_default = config.get(Config.DEFAULTS, 'executable')
        if not exec_default and config.items(Config.EXECUTABLES):
            items = dict(config.items(Config.EXECUTABLES))
            exec_ = items[sorted(items.keys(), reverse=True)[0]]
        else:
            exec_ = exec_default
    else:
        exec_ = config.get(Config.EXECUTABLES, args.version)

    build_maya_environment(config, args.environment, args.path)
    logger.info('\nDone building maya environment, launching: \n{}\n'.format(exec_))
    launch(exec_, args)
994650
def _init(self):
        

        self._entry_points = {}
        for entry_point in self.raw_entry_points:
            if entry_point.dist.project_name != self.reserved.get(
                    entry_point.name, entry_point.dist.project_name):
                logger.error(
                    "registry '%s' for '%s' is reserved for package '%s'",
                    entry_point.name, self.registry_name,
                    self.reserved[entry_point.name],
                )
                continue

            if self.get_record(entry_point.name):
                logger.warning(
                    "registry '%s' for '%s' is already registered.",
                    entry_point.name, self.registry_name,
                )
                existing = self._entry_points[entry_point.name]
                logger.debug(
                    "registered '%s' from '%s'", existing, existing.dist)
                logger.debug(
                    "discarded '%s' from '%s'", entry_point, entry_point.dist)
                continue

            logger.debug(
                "recording '%s' from '%s'", entry_point, entry_point.dist)
            self._entry_points[entry_point.name] = entry_point
193047
private function _init()
    {
        // TODO: check if self::$instance is required here or if we can only set
        // decorated object

        // initialize and store the instance of template engine for further access
        self::$instance = Doozr_Loader_Serviceloader::load($this->library, $this->resource);

        // set this instance as decorated object of our generic Facade and
        // so we can access all the base methods of any lib easily!
        $this->setDecoratedObject(self::$instance);
    }
526447
function initScriptMode () {
		//buffer source node
		let bufferNode = context.createBufferSource()
		bufferNode.loop = true;
		bufferNode.buffer = util.create(samplesPerFrame, channels, {context: context})

		node = context.createScriptProcessor(samplesPerFrame)
		node.addEventListener('audioprocess', function (e) {
			//release causes synchronous pulling the pipeline
			//so that we get a new data chunk
			let cb = release;
			release = null;
			cb && cb()

			if (isStopped) return;

			util.copy(shift(e.inputBuffer.length), e.outputBuffer)
		})

		//start should be done after the connection, or there is a chance it won’t
		bufferNode.connect(node)
		bufferNode.start()

		return node;
	}
225779
def init():
    
    yass_conf = os.path.join(CWD, "yass.yml")
    if os.path.isfile(yass_conf):
        print("::ALERT::")
        print("It seems like Yass is already initialized here.")
        print("If it's a mistake, delete 'yass.yml' in this directory")
    else:
        print("Init Yass in %s ..." % CWD)
        copy_resource("skel/", CWD)
        stamp_yass_current_version(CWD)
        print("Yass init successfully!")
        print("Run 'yass serve' to view the site")

    footer()
819750
def init_engine(self, get_loader):
        
        if get_loader is not None:
            self.engine = SimplePipelineEngine(
                get_loader,
                self.asset_finder,
                self.default_pipeline_domain(self.trading_calendar),
            )
        else:
            self.engine = ExplodingPipelineEngine()