Pack accelerators
512551
function( num ) {
		var n = new Buffer(4);
		if (SAFE) { if (num == 0.0) { }
		else if ((Math.abs(num) < FLOAT32_SMALL) || (num < FLOAT32_NEG) || (num > FLOAT32_POS)) 
			throw new Errors.PackError('Packing float bigger than 32-bits ('+num+')!');
		}
		packViewF32[0] = num;
		for (var i=0; i<4; ++i) n[i]=packViewU8[i];
		return n;
	}
193137
def hydrate_bundles(bundles_field, glob_match_error_behavior):
  """"""
  path_globs_with_match_errors = [
    pg.copy(glob_match_error_behavior=glob_match_error_behavior)
    for pg in bundles_field.path_globs_list
  ]
  snapshot_list = yield [Get(Snapshot, PathGlobs, pg) for pg in path_globs_with_match_errors]

  spec_path = bundles_field.address.spec_path

  bundles = []
  zipped = zip(bundles_field.bundles,
               bundles_field.filespecs_list,
               snapshot_list)
  for bundle, filespecs, snapshot in zipped:
    rel_spec_path = getattr(bundle, 'rel_path', spec_path)
    kwargs = bundle.kwargs()
    # NB: We `include_dirs=True` because bundle filesets frequently specify directories in order
    # to trigger a (deprecated) default inclusion of their recursive contents. See the related
    # deprecation in `pants.backend.jvm.tasks.bundle_create`.
    kwargs['fileset'] = _eager_fileset_with_spec(rel_spec_path,
                                                 filespecs,
                                                 snapshot,
                                                 include_dirs=True)
    bundles.append(BundleAdaptor(**kwargs))
  yield HydratedField('bundles', bundles)
11358
@Override
  public PackingPlan pack() {
    PackingPlanBuilder planBuilder = newPackingPlanBuilder(null);

    // Get the instances using FFD allocation
    try {
      planBuilder = getFFDAllocation(planBuilder);
    } catch (ConstraintViolationException e) {
      throw new PackingException("Could not allocate all instances to packing plan", e);
    }

    return planBuilder.build();
  }
1219873
def simulate(self, nsites, transition_matrix, tree, ncat=1, alpha=1):
        
        sim = SequenceSimulator(transition_matrix, tree, ncat, alpha)
        return list(sim.simulate(nsites).items())
716829
def do_pack(self):
        """"""
        verbosity = self._args.verbose - self._args.quiet
        cache = cmsis_pack_manager.Cache(verbosity < 0, False)
        
        if self._args.clean:
            LOG.info("Removing all pack data...")
            cache.cache_clean()
        
        if self._args.update:
            LOG.info("Updating pack index...")
            cache.cache_descriptors()
        
        if self._args.show:
            packs = pack_target.ManagedPacks.get_installed_packs()
            pt = self._get_pretty_table(["Vendor", "Pack", "Version"])
            for ref in packs:
                pt.add_row([
                            ref.vendor,
                            ref.pack,
                            ref.version,
                            ])
            print(pt)

        if self._args.find_devices or self._args.install_devices:
            if not cache.index:
                LOG.info("No pack index present, downloading now...")
                cache.cache_descriptors()
            
            patterns = self._args.find_devices or self._args.install_devices
            
            # Find matching part numbers.
            matches = set()
            for pattern in patterns:
                # Using fnmatch.fnmatch() was failing to match correctly.
                pat = re.compile(fnmatch.translate(pattern + "*"), re.IGNORECASE)
                results = {name for name in cache.index.keys() if pat.match(name)}
                matches.update(results)
            
            if not matches:
                LOG.warning("No matching devices. Please make sure the pack index is up to date.")
                return
            
            if self._args.find_devices:
                pt = self._get_pretty_table(["Part", "Vendor", "Pack", "Version"])
                for name in sorted(matches):
                    info = cache.index[name]
                    ref, = cache.packs_for_devices([info])
                    pt.add_row([
                                info['name'],
                                ref.vendor,
                                ref.pack,
                                ref.version,
                                ])
                print(pt)
            elif self._args.install_devices:
                devices = [cache.index[dev] for dev in matches]
                packs = cache.packs_for_devices(devices)
                if not self._args.no_download:
                    print("Downloading packs (press Control-C to cancel):")
                else:
                    print("Would download packs:")
                for pack in packs:
                    print("    " + str(pack))
                if not self._args.no_download:
                    cache.download_pack_list(packs)
70290
public void setAccelerators(java.util.Collection<Accelerator> accelerators) {
        if (accelerators == null) {
            this.accelerators = null;
            return;
        }

        this.accelerators = new java.util.ArrayList<Accelerator>(accelerators);
    }
966832
public static void fastpack(final int[] in, final int inpos,
                final int[] out, final int outpos, final int bit) {
                switch (bit) {
                case 0:
                        fastpack0(in, inpos, out, outpos);
                        break;
                case 1:
                        fastpack1(in, inpos, out, outpos);
                        break;
                case 2:
                        fastpack2(in, inpos, out, outpos);
                        break;
                case 3:
                        fastpack3(in, inpos, out, outpos);
                        break;
                case 4:
                        fastpack4(in, inpos, out, outpos);
                        break;
                case 5:
                        fastpack5(in, inpos, out, outpos);
                        break;
                case 6:
                        fastpack6(in, inpos, out, outpos);
                        break;
                case 7:
                        fastpack7(in, inpos, out, outpos);
                        break;
                case 8:
                        fastpack8(in, inpos, out, outpos);
                        break;
                case 9:
                        fastpack9(in, inpos, out, outpos);
                        break;
                case 10:
                        fastpack10(in, inpos, out, outpos);
                        break;
                case 11:
                        fastpack11(in, inpos, out, outpos);
                        break;
                case 12:
                        fastpack12(in, inpos, out, outpos);
                        break;
                case 13:
                        fastpack13(in, inpos, out, outpos);
                        break;
                case 14:
                        fastpack14(in, inpos, out, outpos);
                        break;
                case 15:
                        fastpack15(in, inpos, out, outpos);
                        break;
                case 16:
                        fastpack16(in, inpos, out, outpos);
                        break;
                case 17:
                        fastpack17(in, inpos, out, outpos);
                        break;
                case 18:
                        fastpack18(in, inpos, out, outpos);
                        break;
                case 19:
                        fastpack19(in, inpos, out, outpos);
                        break;
                case 20:
                        fastpack20(in, inpos, out, outpos);
                        break;
                case 21:
                        fastpack21(in, inpos, out, outpos);
                        break;
                case 22:
                        fastpack22(in, inpos, out, outpos);
                        break;
                case 23:
                        fastpack23(in, inpos, out, outpos);
                        break;
                case 24:
                        fastpack24(in, inpos, out, outpos);
                        break;
                case 25:
                        fastpack25(in, inpos, out, outpos);
                        break;
                case 26:
                        fastpack26(in, inpos, out, outpos);
                        break;
                case 27:
                        fastpack27(in, inpos, out, outpos);
                        break;
                case 28:
                        fastpack28(in, inpos, out, outpos);
                        break;
                case 29:
                        fastpack29(in, inpos, out, outpos);
                        break;
                case 30:
                        fastpack30(in, inpos, out, outpos);
                        break;
                case 31:
                        fastpack31(in, inpos, out, outpos);
                        break;
                case 32:
                        fastpack32(in, inpos, out, outpos);
                        break;
                default:
                        throw new IllegalArgumentException(
                                "Unsupported bit width.");
                }
        }
57491
def delayed_unpacking(self, container, fun, *args, **kwargs):
        """"""
        try:
            self._delayed += 1
            blob = self._begin()
            try:
                fun(*args, **kwargs)
                self._commit(blob)
                return container
            except DelayPacking:
                self._rollback(blob)
                continuation = (fun, args, kwargs)
                self._pending.append(continuation)
                return container
        finally:
            self._delayed -= 1
830571
def pack(self):
        '''
        
        '''
        reqdictf = {k.name.lower(): v for (k, v) in self.reqdict.items()}
        incunitf = None if self.incunit is None else self.incunit.name.lower()
        return (reqdictf, incunitf, self.incval)
1118457
protected function collect_packs() {
		$iterator = new DirectoryIterator( $this->dir );

		foreach ( $iterator as $pack_dir ) {
			if ( $pack_dir->isDot() || ! $pack_dir->isDir() || ! $pack_dir->isReadable() ) {
				continue;
			}

			$pack_dirname = $pack_dir->getFilename();
			$pack_data    = $this->get_pack_data( $pack_dir );

			if ( ! empty( $pack_data ) ) {
				$this->packs[ $pack_dirname ] = $pack_data;
			}
		}
	}
266924
function addNotPackPluginRes(target, resFiles) {
    resFiles.forEach(function (item) {
        if (target.indexOf(item) === -1) {
            target.push(item);
        }
    });
}
1195202
function buildPack(ret) {
  var src = ret.src;
  var pack = {};

  Object.keys(src).forEach(function(subpath) {
    var file = src[subpath];
    var packTo = file.packTo;

    if (!packTo || file.release === false || file.isPartial) {
      return;
    }

    pack[packTo] = pack[packTo] || [];
    pack[packTo].push(file.subpath);
  });

  return pack;
}
869294
function Pack(commit, options, rollCall, command) {
	if (!commit || !options || !rollCall || !command) {
		throw new Error('Invalid arguments: ' + arguments);
	}
	this.commit = commit;
	this.options = options;
	this.rollCall = rollCall;
	this.command = command;
}
985230
def pack(self):
        """"""
        sn, sa = self.number, self.attribute
        return pack("<H", (sn & 0x3ff) << 6 | (sa & 0x3f))
257201
def _pack(self, content):
        """"""
        if self.serializer:
            content = self.serializer.serialize(content)
        if self.compressor:
            content = self.compressor.compress(content)
        return content
51201
def _pack(self):
        """"""
        data = ByteBuffer()
        if not hasattr(self, '__fields__'):
            return data.array

        for field in self.__fields__:
            field.encode(self, data)
        return data.array
1252387
def _maybe_pack_examples(self, generator):
    """"""
    if not self.packed_length:
      return generator
    return generator_utils.pack_examples(
        generator,
        self.has_inputs,
        self.packed_length,
        spacing=self.packed_spacing,
        chop_long_sequences=not self.has_inputs)