NHX format:  [&&NHX:prop1=value1:prop2=value2] 
    MB format: ((a[&Z=1,Y=2], b[&Z=1,Y=2]):1.0[&L=1,W=0], ...
195622
def parse_nhx(NHX_string):
    
    # store features
    ndict = {}

    # parse NHX or MB features
    if "[&&NHX:" in NHX_string:
        NHX_string = NHX_string.replace("[&&NHX:", "")
        NHX_string = NHX_string.replace("]", "")
        
        for field in NHX_string.split(":"):
            try:
                pname, pvalue = field.split("=")
                ndict[pname] = pvalue
            except ValueError as e:
                raise NewickError('Invalid NHX format %s' % field)
    return ndict
795772
def _value_equals(value1, value2, all_close):
    '''
    
    '''
    if value1 is None:
        value1 = np.nan
    if value2 is None:
        value2 = np.nan

    are_floats = np.can_cast(type(value1), float) and np.can_cast(type(value2), float)
    if all_close and are_floats:
        return np.isclose(value1, value2, equal_nan=True)
    else:
        if are_floats:
            return value1 == value2 or (value1 != value1 and value2 != value2)
        else:
            return value1 == value2
764234
function formatNumbers(prevParams, decimal) {
  var params = {}, value;
  for (var k in prevParams) {
    value = prevParams[k];
    params[k] = typeof value === 'number' ? decimal(value) : value;
  }
  return params;
}
911188
function (mb, me, cf, sr, il, tnf) {

        var value = tnf;

        if (mb) {
            value = value | 0x80;
        }

        if (me) {
            value = value | 0x40;
        }

        // note if cf: me, mb, li must be false and tnf must be 0x6
        if (cf) {
            value = value | 0x20;
        }

        if (sr) {
            value = value | 0x10;
        }

        if (il) {
            value = value | 0x8;
        }

        return value;
    }
1054980
def map_vals(val, *names, **extra_opts):
    '''
    
    '''
    fill = extra_opts.pop('fill', NOTSET)
    expected_num_elements = len(names)
    val = translate_stringlist(val)
    for idx, item in enumerate(val):
        if not isinstance(item, dict):
            elements = [x.strip() for x in item.split(':')]
            num_elements = len(elements)
            if num_elements < expected_num_elements:
                if fill is NOTSET:
                    raise SaltInvocationError(
                        '\'{0}\' contains {1} value(s) (expected {2})'.format(
                            item, num_elements, expected_num_elements
                        )
                    )
                elements.extend([fill] * (expected_num_elements - num_elements))
            elif num_elements > expected_num_elements:
                raise SaltInvocationError(
                    '\'{0}\' contains {1} value(s) (expected {2})'.format(
                        item,
                        num_elements,
                        expected_num_elements if fill is NOTSET
                            else 'up to {0}'.format(expected_num_elements)
                    )
                )
            val[idx] = dict(zip(names, elements))
    return val
778987
def _value_format(self, value, serie, index):
        
        sum_ = serie.points[index][1]
        if serie in self.series and (
                self.stack_from_top
                and self.series.index(serie) == self._order - 1
                or not self.stack_from_top and self.series.index(serie) == 0):
            return super(StackedLine, self)._value_format(value)
        return '%s (+%s)' % (self._y_format(sum_), self._y_format(value))
487933
function (version1, version2) {
    try {
      if (lodash.isNumber(version1) && lodash.isNumber(version2)) {
        if (version1 > version2) { return 1 }
        if (version1 === version2) { return 0 }
        if (version1 < version2) { return -1 }
      } else if (lodash.isNumber(version1) || lodash.isNumber(version2)) {
        version1 += '';
        version2 += '';
      }

      var version1Array = version1.split('.');
      var version2Array = version2.split('.');

      var ver1IntList = [];
      var ver2IntList = [];

      version1Array.forEach(function (value, index, array) {
        ver1IntList.push(parseInt(value));
      });

      version2Array.forEach(function (value, index, array) {
        ver2IntList.push(parseInt(value));
      });

      // format
      if (ver1IntList.length < ver2IntList.length) {
        var i = 0;
        for (; i < (ver2IntList.length - ver1IntList.length); ++i) {
          ver1IntList.push(0);
        }
      }

      if (ver1IntList.length > ver2IntList.length) {
        var i$1 = 0;
        for (; i$1 < (ver1IntList.length - ver2IntList.length); ++i$1) {
          ver2IntList.push(0);
        }
      }

      var i$2 = 0;
      for (; i$2 < ver1IntList.length; ++i$2) {
        var cVer1 = ver1IntList[i$2];
        var cVer2 = ver2IntList[i$2];

        if (cVer1 > cVer2) { return 1 }
        if (cVer1 < cVer2) { return -1 }
      }

      return 0
    } catch (e) {
      return -1
    }
  }
1181959
def _handleLookupType2Format1(subtable):
    
    kerning = {}
    coverage = subtable.Coverage.glyphs
    valueFormat1 = subtable.ValueFormat1
    pairSets = subtable.PairSet
    for index, leftGlyphName in enumerate(coverage):
        pairSet = pairSets[index]
        for pairValueRecord in pairSet.PairValueRecord:
            rightGlyphName = pairValueRecord.SecondGlyph
            if valueFormat1:
                value = pairValueRecord.Value1
            else:
                value = pairValueRecord.Value2
            if hasattr(value, "XAdvance"):
                value = value.XAdvance
                kerning[leftGlyphName, rightGlyphName] = value
    return kerning
170831
function (x1, x2) {
		var D = x1.length;
		var d = 0;
		for (var i = 0; i < D; i++) {
			var x1i = x1[i];
			var x2i = x2[i];
			d += (x1i - x2i) * (x1i - x2i);
		}
		return d;
	}
506129
function toHex(bignum) {
      var tmp0 = bignum[0] < 0 ? (bignum[0]>>>0) : bignum[0];
      var tmp1 = bignum[1] < 0 ? (bignum[1]>>>0) : bignum[1];
      return tmp0.toString(16) + tmp1.toString(16);
    }
1151959
def _compute_product(map1, map2):
        
        data = map1.data * map2.data
        return HpxMap(data, map1.hpx)
173135
function hsl2rgb(h, m1, m2) {
  return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
}
767987
def _value_format(self, value):
        """"""
        return super(Funnel, self)._value_format(value and abs(value))
374692
def mapping(self, kdims=None, vdims=None, **kwargs):
        ""
        if config.future_deprecations:
            self.param.warning(
                "The mapping method is deprecated and should no "
                "longer be used. Use another one of the common "
                "formats instead, e.g. .dframe, .array or .columns.")

        length = len(self)
        if not kdims: kdims = self.kdims
        if kdims:
            keys = zip(*[self.dimension_values(dim.name)
                         for dim in self.kdims])
        else:
            keys = [()]*length

        if not vdims: vdims = self.vdims
        if vdims:
            values = zip(*[self.dimension_values(dim.name)
                           for dim in vdims])
        else:
            values = [()]*length
        return OrderedDict(zip(keys, values))
656489
def _value_format(self, value):
        """"""
        return super(VerticalPyramid, self)._value_format(value and abs(value))
1270758
def HH(n):
    """"""
    if (n<=0):return Context('1')
    else:
        LL1=LL(n-1)
        HH1=HH(n-1)
        r1 = C1(3**(n-1),2**(n-1)) - LL1 - HH1
        r2 = HH1 - HH1 - HH1
        return r1 + r2
150715
def propjoin(self, prop):
        '''
        
        '''
        pval = s_ast.RelPropValue(kids=(prop,))

        self.ignore(whitespace)

        self.nextmust('-+>')

        self.ignore(whitespace)

        dest = self.absprop()
        return s_ast.PropPivot(kids=(pval, dest), isjoin=True)