--- DD based: Custom PMI ---
177340
public static StatsImpl getStats(DataDescriptor dd, boolean recursive) {
        if (disabled)
            return null;
        return getStats(findModuleItem(dd), recursive);
    }
1172710
function setDpi() {
    const dpiO = {};
    const e = document.body.appendChild( document.createElement( 'DIV' ) );
    e.style.width = '1in';
    e.style.padding = '0';
    dpiO.v = e.offsetWidth;
    e.parentNode.removeChild( e );
    dpi = dpiO.v;
}
762526
protected final PrcManufactureGfr<RS> createPutPrcManufactureGfr(
    final Map<String, Object> pAddParam) throws Exception {
    PrcManufactureGfr<RS> proc = new PrcManufactureGfr<RS>();
    @SuppressWarnings("unchecked")
    IEntityProcessor<Manufacture, Long> procDlg =
      (IEntityProcessor<Manufacture, Long>)
        lazyGetPrcAccDocGetForReverse(pAddParam);
    proc.setPrcAccDocGetForReverse(procDlg);
    //assigning fully initialized object:
    this.processorsMap.put(PrcManufactureGfr.class.getSimpleName(), proc);
    return proc;
  }
932734
public static DataDescriptor[] listMembers(DataDescriptor dd) {
        if (disabled)
            return null;
        if (dd == null || dd.getPath() == null) {
            // server
            return listMembers();
        } else if (dd.getType() == TYPE_INVALID) {
            return null;
        } else {
            // find the module
            ModuleItem module = findModuleItem(dd);
            if (module == null)
                return null;
            else
                return module.listMembers(dd, false); //false=>pmi based
        }
    }
539790
def fill_parentidid2obj_r0(self, id2obj, child_obj):
        """"""
        for parent_obj in child_obj.parents:
            if parent_obj.item_id not in id2obj:
                id2obj[parent_obj.item_id] = parent_obj
                self.fill_parentidid2obj_r0(id2obj, parent_obj)
508658
@SuppressWarnings("unchecked")
    public void fromDmr(Object entity, String javaName, ModelType dmrType, Class<?> propertyType, ModelNode dmrPayload) throws Exception {

        Method target = entity.getClass().getMethod(javaName, propertyType);
        List<ModelNode> items = dmrPayload.isDefined() ? dmrPayload.asList() : Collections.EMPTY_LIST;

        if(items.isEmpty()) {
            target.invoke(entity, Collections.EMPTY_LIST);
        }
        else
        {
            List list = new ArrayList(items.size());

            // java type is derived from list item dmr type
            ModelType listValueType = items.get(0).getType();
            for (ModelNode item : items) {
                addJavaValueTo(list, listValueType, item);
            }

            target.invoke(entity, list);
        }


    }
443093
public final void pcmpestri(XMMRegister dst, XMMRegister src, Immediate imm8)
  {
    emitX86(INST_PCMPESTRI, dst, src, imm8);
  }
868770
function extractMDNProperties(mdnEntry) {
  if (mdnEntry.status === 'standard') {
    return {
      syntax: mdnEntry.syntax
    }
  }

  return {
    status: abbreviateStatus(mdnEntry.status),
    syntax: mdnEntry.syntax
  }
}
753598
def generate_scheduling_block_id(num_blocks, project='test'):
    """"""
    _date = strftime("%Y%m%d", gmtime())
    _project = project
    for i in range(num_blocks):
        yield '{}-{}-sbi{:03d}'.format(_date, _project, i)
852358
@Override
	public AssetModelMonteCarloSimulationModel getCloneWithModifiedData(Map<String, Object> dataModified) {
		/*
		 * Determine the new model parameters from the provided parameter map.
		 */
		double	newInitialTime	= dataModified.get("initialTime") != null	? ((Number)dataModified.get("initialTime")).doubleValue() : getTime(0);
		double	newInitialValue	= dataModified.get("initialValue") != null	? ((Number)dataModified.get("initialValue")).doubleValue() : initialValue;
		double	newRiskFreeRate	= dataModified.get("riskFreeRate") != null	? ((Number)dataModified.get("riskFreeRate")).doubleValue() : model.getRiskFreeRate().getAverage();
		double	newVolatility	= dataModified.get("volatility") != null	? ((Number)dataModified.get("volatility")).doubleValue()	: model.getVolatility().getAverage();
		int		newSeed			= dataModified.get("seed") != null			? ((Number)dataModified.get("seed")).intValue()				: seed;

		/*
		 * Create a new model with the new model parameters
		 */
		BrownianMotion brownianMotion;
		if(dataModified.get("seed") != null) {
			// The seed has changed. Hence we have to create a new BrownianMotionLazyInit.
			brownianMotion = new BrownianMotionLazyInit(this.getTimeDiscretization(), 1, this.getNumberOfPaths(), newSeed);
		}
		else
		{
			// The seed has not changed. We may reuse the random numbers (Brownian motion) of the original model
			brownianMotion = (BrownianMotion)model.getProcess().getStochasticDriver();
		}

		double timeShift = newInitialTime - getTime(0);
		if(timeShift != 0) {
			ArrayList<Double> newTimes = new ArrayList<>();
			newTimes.add(newInitialTime);
			for(Double time : model.getProcess().getStochasticDriver().getTimeDiscretization()) {
				if(time > newInitialTime) {
					newTimes.add(time);
				}
			}
			TimeDiscretization newTimeDiscretization = new TimeDiscretizationFromArray(newTimes);
			brownianMotion = brownianMotion.getCloneWithModifiedTimeDiscretization(newTimeDiscretization);
		}
		MonteCarloProcessFromProcessModel process = new EulerSchemeFromProcessModel(brownianMotion);
		return new MonteCarloBlackScholesModel(newInitialValue, newRiskFreeRate, newVolatility, process);
	}
332293
public final void pcmpestrm(XMMRegister dst, XMMRegister src, Immediate imm8)
  {
    emitX86(INST_PCMPESTRM, dst, src, imm8);
  }
1297680
@Override
	public CommerceTaxFixedRate create(long commerceTaxFixedRateId) {
		CommerceTaxFixedRate commerceTaxFixedRate = new CommerceTaxFixedRateImpl();

		commerceTaxFixedRate.setNew(true);
		commerceTaxFixedRate.setPrimaryKey(commerceTaxFixedRateId);

		commerceTaxFixedRate.setCompanyId(companyProvider.getCompanyId());

		return commerceTaxFixedRate;
	}
56400
def _compute_dlt(self):
        """"""
        res = super()._compute_dlt()
        for rec in self:
            ltaf_to_apply = self.env['ddmrp.adjustment'].search(
                rec._ltaf_to_apply_domain())
            if ltaf_to_apply:
                ltaf = 1
                values = ltaf_to_apply.mapped('value')
                for val in values:
                    ltaf *= val
                prev = rec.dlt
                rec.dlt *= ltaf
                _logger.debug(
                    "LTAF=%s applied to %s. DLT: %s -> %s" %
                    (ltaf, rec.name, prev, rec.dlt))
        return res
999690
function perfFindInterlacedInserts(multiplier) {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;

  var loopIterations = arraySize;
  if (typeof (multiplier) != "undefined") {
    loopIterations = loopIterations * multiplier;
  }

  for (var idx = 0; idx < loopIterations; idx++) {
    var customidx = Math.floor(Math.random() * arraySize) + 1;

    start = process.hrtime();
    var results = samplecoll.find({
      'customId': customidx
    });
    // insert junk record, now (outside timing routine) to force index rebuild
    var obj = samplecoll.insert({
        customId: 999,
        val: 999,
        val2: 999,
        val3: "more data 1234567890"
    });  
    
    end = process.hrtime(start);
    totalTimes.push(end);
    
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("interlaced inserts + coll.find() : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
  
}
1152188
def dms2dd(d,m,s):
    
    if d < 0:
        sign = -1
    else:
        sign = 1
    dd = sign * (int(abs(d)) + float(m) / 60 + float(s) / 3600)
    return dd
109205
def MakePmfFromDict(d, name=''):
    
    pmf = Pmf(d, name)
    pmf.Normalize()
    return pmf
315660
public final void pcmpistri(XMMRegister dst, XMMRegister src, Immediate imm8)
  {
    emitX86(INST_PCMPISTRI, dst, src, imm8);
  }