- Fleece-related
343679
public C4Replicator createReplicator(
        C4Socket openSocket,
        int push, int pull,
        byte[] options,
        C4ReplicatorListener listener,
        Object replicatorContext)
        throws LiteCoreException {
        return new C4Replicator(handle, openSocket.handle, push, pull,
            options, listener, replicatorContext);
    }
761668
boolean fitLinesUsingCorners( int numLines , GrowQueue_I32 cornerIndexes) {
		for (int i = 1; i <= numLines; i++) {
			int index0 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i - 1, cornerIndexes.size));
			int index1 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i, cornerIndexes.size));

			if( index0 == index1 )
				return false;

			if (!fitLine(index0, index1, lines.get(i - 1))) {
				// TODO do something more intelligent here.  Just leave the corners as is?
				return false;
			}
			LineGeneral2D_F64 l = lines.get(i-1);
			if( Double.isNaN(l.A) || Double.isNaN(l.B) || Double.isNaN(l.C)) {
				throw new RuntimeException("This should be impossible");
			}
		}
		return true;
	}
1195316
function loggingRetryStrategy(err /*, response*/) {
    if (err && err.code === 'ECONNRESET') {
      grunt.verbose.writeln('Transient network error (' + err.code + ')');
      return true;
    }
    return false;
  }
505619
function(bodyWrap) {
        var error = this._check_streamerror(bodyWrap, Strophe.Status.CONNFAIL);
        if (error) {
            return Strophe.Status.CONNFAIL;
        }
    }
1249935
@Override protected Skin createDefaultSkin() {
        switch (skinType) {
            case SMOOTHED_CHART   : return new SmoothedChartTileSkin(Tile.this);
            case BAR_CHART        : return new BarChartTileSkin(Tile.this);
            case CLOCK            : return new ClockTileSkin(Tile.this);
            case GAUGE            : return new GaugeTileSkin(Tile.this);
            case HIGH_LOW         : return new HighLowTileSkin(Tile.this);
            case PERCENTAGE       : return new PercentageTileSkin(Tile.this);
            case PLUS_MINUS       : return new PlusMinusTileSkin(Tile.this);
            case SLIDER           : return new SliderTileSkin(Tile.this);
            case SPARK_LINE       : return new SparkLineTileSkin(Tile.this);
            case SWITCH           : return new SwitchTileSkin(Tile.this);
            case WORLDMAP         : return new WorldMapTileSkin(Tile.this);
            case TIMER_CONTROL    : return new TimerControlTileSkin(Tile.this);
            case NUMBER           : return new NumberTileSkin(Tile.this);
            case TEXT             : return new TextTileSkin(Tile.this);
            case WEATHER          : return new WeatherTileSkin(Tile.this);
            case TIME             : return new TimeTileSkin(Tile.this);
            case CUSTOM           : return new CustomTileSkin(Tile.this);
            case LEADER_BOARD     : return new LeaderBoardTileSkin(Tile.this);
            case MAP              : return new MapTileSkin(Tile.this);
            case RADIAL_CHART     : return new RadialChartTileSkin(Tile.this);
            case DONUT_CHART      : return new DonutChartTileSkin(Tile.this);
            case CIRCULAR_PROGRESS: return new CircularProgressTileSkin(Tile.this);
            case STOCK            : return new StockTileSkin(Tile.this);
            case GAUGE_SPARK_LINE : return new GaugeSparkLineTileSkin(Tile.this);
            case SMOOTH_AREA_CHART: return new SmoothAreaChartTileSkin(Tile.this);
            case RADAR_CHART      : return new RadarChartTileSkin(Tile.this);
            case COUNTRY          : return new CountryTileSkin(Tile.this);
            case EPHEMERIS        : return new EphemerisTileSkin(Tile.this);
            case CHARACTER        : return new CharacterTileSkin(Tile.this);
            case FLIP             : return new FlipTileSkin(Tile.this);
            case SWITCH_SLIDER    : return new SwitchSliderTileSkin(Tile.this);
            case DATE             : return new DateTileSkin(Tile.this);
            case CALENDAR         : return new CalendarTileSkin(Tile.this);
            case SUNBURST         : return new SunburstChartTileSkin(Tile.this);
            case MATRIX           : return new MatrixTileSkin(Tile.this);
            case RADIAL_PERCENTAGE: return new RadialPercentageTileSkin(Tile.this);
            case STATUS           : return new StatusTileSkin(Tile.this);
            case BAR_GAUGE        : return new BarGaugeTileSkin(Tile.this);
            case IMAGE            : return new ImageTileSkin(Tile.this);
            default               : return new TileSkin(Tile.this);
        }
    }
526272
function () {
        this._patterns
            .map(pattern => this._getPatternLayers(pattern))
            .forEach(layers => { this.addLayer(L.featureGroup(layers)); });
    }
585044
function itemY(legend, itemNumber) {
  var cumSpacingAbove = legend.items
    .slice(itemNumber)
    .reduce(function(prev, item) {
      return prev + (item.spacingAbove || 0);
    }, 0);
  return (
    (legend.items.length - itemNumber - 1) *
      (legend.computedItemHeight + legend.itemSpacing) +
    cumSpacingAbove
  );
}
465222
function setup() {
        var tmp = get('skin')
        if (tmp && $.inArray(tmp, mySkins))
            changeSkin(tmp)

        // Add the change skin listener
        $('[data-skin]').on('click', function (e) {
            if ($(this).hasClass('knob'))
                return
            e.preventDefault()
            changeSkin($(this).data('skin'))
        })

        // Add the layout manager
        $('[data-layout]').on('click', function () {
            changeLayout($(this).data('layout'))
        })

        $('[data-controlsidebar]').on('click', function () {
            changeLayout($(this).data('controlsidebar'))
            var slide = !$controlSidebar.options.slide

            $controlSidebar.options.slide = slide
            if (!slide)
                $('.control-sidebar').removeClass('control-sidebar-open')
        })

        $('[data-sidebarskin="toggle"]').on('click', function () {
            var $sidebar = $('.control-sidebar')
            if ($sidebar.hasClass('control-sidebar-dark')) {
                $sidebar.removeClass('control-sidebar-dark')
                $sidebar.addClass('control-sidebar-light')
            } else {
                $sidebar.removeClass('control-sidebar-light')
                $sidebar.addClass('control-sidebar-dark')
            }
        })

        $('[data-enable="expandOnHover"]').on('click', function () {
            $(this).attr('disabled', true)
            $pushMenu.expandOnHover()
            if (!$('body').hasClass('sidebar-collapse'))
                $('[data-layout="sidebar-collapse"]').click()
        })

        //  Reset options
        if ($('body').hasClass('fixed')) {
            $('[data-layout="fixed"]').attr('checked', 'checked')
        }
        if ($('body').hasClass('layout-boxed')) {
            $('[data-layout="layout-boxed"]').attr('checked', 'checked')
        }
        if ($('body').hasClass('sidebar-collapse')) {
            $('[data-layout="sidebar-collapse"]').attr('checked', 'checked')
        }

    }
103956
def Eg(self, **kwargs):
        '''
        
        '''
        return self.unstrained.Eg(**kwargs) + self.Eg_strain_shift(**kwargs)
1362123
function(q, lowerTail, logp) {
        return lowerTail ? logp ? log1p(-q) : 1 - q
                         : logp ? Math.log(q) : q;
      }
986747
function changeSkin(cls) {
        $.each(mySkins, function (i) {
            $('body').removeClass(mySkins[i])
        })

        $('body').addClass(cls)
        store('skin', cls)
        return false
    }
525540
function emitMatches(str, pattern, options) {
  glob.emit('match', getFiles(str, pattern, options), options.cwd);
}
423661
function parseASCIIChunk(workChunk) {
  var data = (0, _utils.ensureString)(workChunk);
  // console.log('parseASCII')
  var result = void 0,
      text = void 0;
  var patternNormal = /normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
  var patternVertex = /vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
  var patternFace = /facet([\s\S]*?)endfacet/g;

  var posArray = [];
  var normArray = [];

  var faces = 0;
  var offset = 0;

  while ((result = patternFace.exec(data)) !== null) {
    var length = 0;

    text = result[0];
    offset = result.index + text.length;

    while ((result = patternNormal.exec(text)) !== null) {
      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));
      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));
      normArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));
    }

    while ((result = patternVertex.exec(text)) !== null) {
      posArray.push(parseFloat(result[1]), parseFloat(result[3]), parseFloat(result[5]));
      length += 1;
    }
    faces += 1;
  }

  var positions = new Float32Array(faces * 3 * 3);
  var normals = new Float32Array(faces * 3 * 3);

  positions.set(posArray);
  normals.set(normArray);

  // compute offsets, remainderData etc for next chunk etc
  var remainderTextData = data.slice(offset);
  // console.log('remainderData', remainderTextData)
  var remainderData = new Buffer(remainderTextData);
  return { faceOffset: faces, remainderData: remainderData, positions: positions, normals: normals };
}
495858
public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
        if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
            throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
                    + (positionStart + itemCount - 1) + "] is not within the position bounds for footer items [0 - "
                    + (footerItemCount - 1) + "].");
        }
        notifyItemRangeChanged(positionStart + headerItemCount + contentItemCount, itemCount);
    }
594132
private void inheritPackageAttributes(Map<String, AttributeDescr> pkgAttributes,
                                          RuleDescr ruleDescr) {
        if (pkgAttributes == null) {
            return;
        }
        for (AttributeDescr attrDescr : pkgAttributes.values()) {
            ruleDescr.getAttributes().putIfAbsent(attrDescr.getName(), attrDescr);
        }
    }
197390
def heatcapacity(ddtt):
    
    object_type = ddtt.obj[0]
    if object_type == 'Construction':
        heatcapacity = 0
        layers = ddtt.obj[2:]
        field_idd = ddtt.getfieldidd('Outside_Layer')
        validobjects = field_idd['validobjects']
        for layer in layers:
            found = False
            for key in validobjects:
                try:
                    heatcapacity += ddtt.theidf.getobject(key, layer).heatcapacity
                    found = True
                except AttributeError:
                    pass
            if not found:
                raise AttributeError("%s material not found in IDF" % layer)
    elif object_type == 'Material':
        thickness = ddtt.obj[ddtt.objls.index('Thickness')]
        density = ddtt.obj[ddtt.objls.index('Density')]
        specificheat = ddtt.obj[ddtt.objls.index('Specific_Heat')]
        heatcapacity = thickness * density * specificheat * 0.001
    elif object_type == 'Material:AirGap':
        heatcapacity = 0
    elif object_type == 'Material:InfraredTransparent':
        heatcapacity = 0
    elif object_type == 'Material:NoMass':
        warnings.warn(
            "Material:NoMass materials included in heat capacity calculation",
            UserWarning)
        heatcapacity = 0
    elif object_type == 'Material:RoofVegetation':
        warnings.warn(
            "Material:RoofVegetation thermal properties are based on dry soil",
            UserWarning)
        thickness = ddtt.obj[ddtt.objls.index('Thickness')]
        density = ddtt.obj[ddtt.objls.index('Density_of_Dry_Soil')]
        specificheat = ddtt.obj[ddtt.objls.index('Specific_Heat_of_Dry_Soil')]
        heatcapacity = thickness * density * specificheat * 0.001
    else:
        raise AttributeError("%s has no heatcapacity property" % object_type)
    return heatcapacity
641971
def bowtie(sam, btd, f, r, u, opt, no_shrink, threads):
    
    bt2 = 'bowtie2 -x %s -p %s ' % (btd, threads)
    if f is not False:
        bt2 += '-1 %s -2 %s ' % (f, r)
    if u is not False:
        bt2 += '-U %s ' % (u)
    bt2 += opt
    if no_shrink is False:
        if f is False:
            bt2 += ' | shrinksam -u -k %s-shrunk.sam ' % (sam)
        else:
            bt2 += ' | shrinksam -k %s-shrunk.sam ' % (sam)
    else:
        bt2 += ' > %s.sam' % (sam)
    return bt2