Set MeCab binary location
774208
def _register_mecab_loc(location):
    '''  '''
    global MECAB_LOC
    if not os.path.isfile(location):
        logging.getLogger(__name__).warning("Provided mecab binary location does not exist {}".format(location))
    logging.getLogger(__name__).info("Mecab binary is switched to: {}".format(location))
    MECAB_LOC = location
1012450
def find_mecab_dictionary(names):
    
    suggested_pkg = names[0]
    paths = [
        os.path.expanduser('~/.local/lib/mecab/dic'),
        '/var/lib/mecab/dic',
        '/var/local/lib/mecab/dic',
        '/usr/lib/mecab/dic',
        '/usr/local/lib/mecab/dic',
        '/usr/lib/x86_64-linux-gnu/mecab/dic',
    ]
    full_paths = [os.path.join(path, name) for path in paths for name in names]
    checked_paths = [path for path in full_paths if len(path) <= MAX_PATH_LENGTH]
    for path in checked_paths:
        if os.path.exists(path):
            return path

    error_lines = [
        "Couldn't find the MeCab dictionary named %r." % suggested_pkg,
        "You should download or use your system's package manager to install",
        "the %r package." % suggested_pkg,
        "",
        "We looked in the following locations:"
    ] + ["\t%s" % path for path in checked_paths]

    skipped_paths = [path for path in full_paths if len(path) > MAX_PATH_LENGTH]
    if skipped_paths:
        error_lines += [
            "We had to skip these paths that are too long for MeCab to find:",
        ] + ["\t%s" % path for path in skipped_paths]

    raise OSError('\n'.join(error_lines))
223762
def visit_BinaryOperation(self, node):
        """"""
        self.visit(node.left)
        self.visit(node.right)
1170439
def __mktmp(self):
        """"""
        try:
            if not os.path.isdir(self.location):
                os.makedirs(self.location)
        except Exception:
            log.debug(self.location, exc_info=1)
        return self
1022860
def binary(self):
    """"""
    lib_name = '{}.so'.format(NATIVE_ENGINE_MODULE)
    lib_path = os.path.join(safe_mkdtemp(), lib_name)
    try:
      with closing(pkg_resources.resource_stream(__name__, lib_name)) as input_fp:
        # NB: The header stripping code here must be coordinated with header insertion code in
        #     build-support/bin/native/bootstrap_code.sh
        engine_version = input_fp.readline().decode('utf-8').strip()
        repo_version = input_fp.readline().decode('utf-8').strip()
        logger.debug('using {} built at {}'.format(engine_version, repo_version))
        with open(lib_path, 'wb') as output_fp:
          output_fp.write(input_fp.read())
    except (IOError, OSError) as e:
      raise self.BinaryLocationError(
        "Error unpacking the native engine binary to path {}: {}".format(lib_path, e),
        e)
    return lib_path
152431
protected function setAppDirectoryNamespace()
	{
		$files = Finder::create()
                            ->in($this->laravel['path'])
                            ->name('*.php');

		foreach ($files as $file)
		{
			$this->replaceNamespace($file->getRealPath());
		}
	}
471443
public void setBinary(File binary) {
    options.get(BINARY).setValue(BINARY.sanitize(binary));
  }
36691
function write_wb_bin(wb, opts) {
	var ba = buf_array();
	write_record(ba, "BrtBeginBook");
	write_record(ba, "BrtFileVersion", write_BrtFileVersion());
	/* [[BrtFileSharingIso] BrtFileSharing] */
	write_record(ba, "BrtWbProp", write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null));
	/* [ACABSPATH] */
	/* [[BrtBookProtectionIso] BrtBookProtection] */
	write_BOOKVIEWS(ba, wb, opts);
	write_BUNDLESHS(ba, wb, opts);
	/* [FNGROUP] */
	/* [EXTERNALS] */
	/* *BrtName */
	/* write_record(ba, "BrtCalcProp", write_BrtCalcProp()); */
	/* [BrtOleSize] */
	/* *(BrtUserBookView *FRT) */
	/* [PIVOTCACHEIDS] */
	/* [BrtWbFactoid] */
	/* [SMARTTAGTYPES] */
	/* [BrtWebOpt] */
	/* write_record(ba, "BrtFileRecover", write_BrtFileRecover()); */
	/* [WEBPUBITEMS] */
	/* [CRERRS] */
	/* FRTWORKBOOK */
	write_record(ba, "BrtEndBook");

	return ba.end();
}
972483
def use_federated_bin_view(self):
        """"""
        self._bin_view = FEDERATED
        # self._get_provider_session('resource_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_federated_bin_view()
            except AttributeError:
                pass
1061143
def set_bin_window(self, bin_size=None, window_size=None):
        """"""
        bin_size = bin_size or self.bin_size
        window_size = window_size or self.window_size
        assert 1e-6 < bin_size < 1e3
        assert 1e-6 < window_size < 1e3
        assert bin_size < window_size
        self.bin_size = bin_size
        self.window_size = window_size
        # Set the status message.
        b, w = self.bin_size * 1000, self.window_size * 1000
        self.set_status('Bin: {:.1f} ms. Window: {:.1f} ms.'.format(b, w))
716057
function _checkRootCA () {
  var caKeyFilePath = path.join(certDir, 'ca.key');
  var caCrtFilePath = path.join(certDir, 'ca.crt');

  var keysDir = path.join(__dirname, '..', 'keys');

  if (!fs.existsSync(caKeyFilePath) || !fs.existsSync(caCrtFilePath)) {
    log.debug('CA files do not exist');
    log.debug('Copy CA files');
    fse.copySync(path.join(keysDir, 'ca.key'), caKeyFilePath);
    fse.copySync(path.join(keysDir, 'ca.crt'), caCrtFilePath);
  }
}
364095
public function setLessBinary($lessBinary)
    {
        if (null !== $lessBinary) {
            Assert::string($lessBinary, 'The less binary must be a string or null. Got: %s');
            Assert::notEmpty($lessBinary, 'The less binary must not be empty.');
        }

        $this->lessBinary = $lessBinary;
    }
652043
private function doGetBinaryBitsetLeInt()
    {
        $bin = \pack(\PHP_INT_SIZE === 8 ? 'P' : 'V', $this->bitset);
        return \substr($bin, 0, (int)\ceil($this->enumerationCount / 8));
    }
964912
public static function getBinaryPath(): string
    {
        $binaryName = Utilities::getReleaseName();
        $binaryPath = sprintf('%s/bin/%s', Utilities::getBasePath(), $binaryName);

        return $binaryPath;
    }
542510
def select(self, binary_request):
    """"""

    logger.debug("binary_request: {!r}".format(binary_request))

    try:
      download_path = self._get_download_path(binary_request)
    except self.MissingMachineInfo as e:
      raise self.BinaryResolutionError(binary_request, e)

    try:
      url_generator = self._get_url_generator(binary_request)
    except self.NoBaseUrlsError as e:
      raise self.BinaryResolutionError(binary_request, e)

    urls = self._get_urls(url_generator, binary_request)
    if not isinstance(urls, list):
      # TODO: add test for this error!
      raise self.BinaryResolutionError(
        binary_request,
        TypeError("urls must be a list: was '{}'.".format(urls)))
    fetch_request = BinaryFetchRequest(
      download_path=download_path,
      urls=urls)

    logger.debug("fetch_request: {!r}".format(fetch_request))

    try:
      downloaded_file = self._binary_tool_fetcher.fetch_binary(fetch_request)
    except BinaryToolFetcher.BinaryNotFound as e:
      raise self.BinaryResolutionError(binary_request, e)

    # NB: we mark the downloaded file executable if it is not an archive.
    archiver = binary_request.archiver
    if archiver is None:
      chmod_plus_x(downloaded_file)
      return downloaded_file

    download_dir = os.path.dirname(downloaded_file)
    # Use the 'name' given in the request as the directory name to extract to.
    unpacked_dirname = os.path.join(download_dir, binary_request.name)
    if not os.path.isdir(unpacked_dirname):
      logger.info("Extracting {} to {} .".format(downloaded_file, unpacked_dirname))
      archiver.extract(downloaded_file, unpacked_dirname, concurrency_safe=True)
    return unpacked_dirname
824555
def packb(obj, **kwargs):
    """"""
    kwargs.setdefault('use_bin_type', True)
    return msgpack.packb(obj, **kwargs)
525211
protected function whichFrom($binary, array $locations)
    {
        $location = false;

        // Look in all the locations
        $tryout = 0;
        while (!$location && array_key_exists($tryout, $locations)) {
            // Execute method if required
            $location = $locations[$tryout];
            if (is_array($location)) {
                list($object, $method, $argument) = $location;
                $location = $object->$method($argument);
            }

            // Verify existence of returned path
            if ($location && $location !== $this->paths->getPath($binary)) {
                $location = $this->rawWhich($location);
            }

            ++$tryout;
        }

        // Store found location or remove it if invalid
        if (!$this->modulable->connections->is('local')) {
            if ($location) {
                $this->localStorage->set($this->getBinaryStoragePath($binary), $location);
            } else {
                $this->localStorage->forget($this->getBinaryStoragePath($binary));
            }
        }

        return $location ?: $binary;
    }