returns the bits that have a semitone above them
540190
function hemitonics($scale = null) {
		if (is_null($scale)) {
			$scale = $this->scale;
		}
		return $this->findIntervalics(1, $scale);
	}
9988
function reverseBits(x, bits) {
      var y = 0;

      for (var i = 0; i < bits; i++) {
        y = (y << 1) | (x & 1);
        x >>>= 1;
      }

      return y;
    }
467296
def _values(self):
        """"""
        return [abs(val) for val in super(Dot, self)._values if val != 0]
1352210
def comparable(self):
    """"""
    string_parts = []

    if self.location is not None:
      string_parts.append('location: {0:s}'.format(self.location))
    if self.part_index is not None:
      string_parts.append('part index: {0:d}'.format(self.part_index))
    if self.start_offset is not None:
      string_parts.append('start offset: 0x{0:08x}'.format(self.start_offset))

    return self._GetComparable(sub_comparable_string=', '.join(string_parts))
1306119
public static function spectrum($bits) {
		$spectrum = array();
		$rotateme = $bits;
		for ($i=0; $i<6; $i++) {
			$rotateme = self::rotateBitmask($rotateme, $direction = 1, $amount = 1);
			$spectrum[$i] = self::countOnBits($bits & $rotateme);
		}
		// special rule: if there is a tritone in the sonority, it will show up twice, so we divide by 2
		$spectrum[5] = $spectrum[5] / 2;
		return $spectrum;
	}
488812
def p_BIT(p):
    
    bit = p[2].eval()
    if bit < 0 or bit > 7:
        error(p.lineno(3), 'Invalid bit position %i. Must be in [0..7]' % bit)
        p[0] = None
        return

    p[0] = Asm(p.lineno(3), '%s %i,%s' % (p[1], bit, p[4]))
733122
private int countNonNegativeBits(final Tristate[] bits) {
    int result = 0;
    for (final Tristate bit : bits)
      if (bit != Tristate.FALSE)
        result++;
    return result;
  }
830056
function divide(bit) {
  var bitString = ((zeros + zeros) + (Number(bit).toString(2))).slice(-64);

  return [
    parseInt(bitString.slice(0, 32), 2), // hi
    parseInt(bitString.slice(-32), 2) // lo
  ];
}
133148
def _bits_to_float(bits, lower=-90.0, middle=0.0, upper=90.0):
  """"""
  for i in bits:
    if i:
      lower = middle
    else:
      upper = middle
    middle = (upper + lower) / 2
  return middle
1051038
function () {
            return [
                        __.filter (123, _.constant (456)).assert (456),
                        __.filter (['foo', 456], _.isString).assert (['foo']),
                        __.filter (['foo', 456], __.constant ('baz')).assert (['baz', 'baz']),
                        __.filter ({ foo: 123, bar: '456' }, _.isNumber).assert ({ foo: 123 })
                    ] }
167714
private UnicodeSet getEquivalentDecimals(String decimal, boolean strictParse) {
        UnicodeSet equivSet = UnicodeSet.EMPTY;
        if (strictParse) {
            if (strictDotEquivalents.contains(decimal)) {
                equivSet = strictDotEquivalents;
            } else if (strictCommaEquivalents.contains(decimal)) {
                equivSet = strictCommaEquivalents;
            }
        } else {
            if (dotEquivalents.contains(decimal)) {
                equivSet = dotEquivalents;
            } else if (commaEquivalents.contains(decimal)) {
                equivSet = commaEquivalents;
            }
        }
        return equivSet;
    }
1158678
def parseBits(self, hexcode, width):
        """"""
        bitarray = []
        for byte in hexcode[::-1]:
            bits = int(byte, 16)
            for x in range(4):
                bitarray.append(bool((2 ** x) & bits))
        bitarray = bitarray[::-1]
        return enumerate(bitarray[:width])
1153467
def _pitch_classes():
    '''
    pitch_classes = ['C', 'D', 'E', 'F', 'G', 'A', 'B']
    semitones = [0, 2, 4, 5, 7, 9, 11]
    return dict([(c, s) for c, s in zip(pitch_classes, semitones)])
1371221
def getAceTypeBit(self, t):
        '''
        
        '''
        try:
            return self.validAceTypes[t]['BITS']
        except KeyError:
            raise CommandExecutionError((
                'No ACE type "{0}".  It should be one of the following:  {1}'
                ).format(t, ', '.join(self.validAceTypes)))
877065
public int get_bits(int number_of_bits)
  {
  	int				returnvalue = 0;
  	int 			sum = bitindex + number_of_bits;

	// E.B
	// There is a problem here, wordpointer could be -1 ?!
    if (wordpointer < 0) wordpointer = 0;
    // E.B : End.

  	if (sum <= 32)
  	{
	   // all bits contained in *wordpointer
	   returnvalue = (framebuffer[wordpointer] >>> (32 - sum)) & bitmask[number_of_bits];
	   // returnvalue = (wordpointer[0] >> (32 - sum)) & bitmask[number_of_bits];
	   if ((bitindex += number_of_bits) == 32)
	   {
		 bitindex = 0;
		 wordpointer++; // added by me!
	   }
	   return returnvalue;
    }

    // E.B : Check that ?
    //((short[])&returnvalue)[0] = ((short[])wordpointer + 1)[0];
    //wordpointer++; // Added by me!
    //((short[])&returnvalue + 1)[0] = ((short[])wordpointer)[0];
	int Right = (framebuffer[wordpointer] & 0x0000FFFF);
	wordpointer++;
	int Left = (framebuffer[wordpointer] & 0xFFFF0000);
	returnvalue = ((Right << 16) & 0xFFFF0000) | ((Left >>> 16)& 0x0000FFFF);

    returnvalue >>>= 48 - sum;	// returnvalue >>= 16 - (number_of_bits - (32 - bitindex))
    returnvalue &= bitmask[number_of_bits];
    bitindex = sum - 32;
    return returnvalue;
}
1055559
function checkInclude7(i) {
  const start = i;
  let l;

  if (tokens[i].type === TokenType.PlusSign) i++;
  else return 0;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkBlock(i)) i += l;
  else return 0;

  return i - start;
}
1081876
function ze(pt,ut,bt,ht){var It=pt.indexOf("."),At=We,wt=Xe,mt,yt,_t,vt,xt,St,kt;// Remove trailing zeros.
for(37>bt&&(pt=pt.toLowerCase()),0<=It&&(_t=dt,dt=0,pt=pt.replace(".",""),kt=new Le(bt),xt=kt.pow(pt.length-It),dt=_t,kt.c=ue(he(ce(xt.c),xt.e),10,ut),kt.e=kt.c.length),St=ue(pt,bt,ut),yt=_t=St.length;0==St[--_t];St.pop());if(!St[0])return"0";if(0>It?--yt:(xt.c=St,xt.e=yt,xt.s=ht,xt=qe(xt,kt,At,wt,ut),St=xt.c,vt=xt.r,yt=xt.e),mt=yt+At+1,It=St[mt],_t=ut/2,vt=vt||0>mt||null!=St[mt+1],vt=4>wt?(null!=It||vt)&&(0==wt||wt==(0>xt.s?3:2)):It>_t||It==_t&&(4==wt||vt||6==wt&&1&St[mt-1]||wt==(0>xt.s?8:7)),1>mt||!St[0])pt=vt?he("1",-At):"0";else{if(St.length=mt,vt)// Rounding up may mean the previous digit has to be rounded up and so on.
for(--ut;++St[--mt]>ut;)St[mt]=0,mt||(++yt,St.unshift(1));// Determine trailing zeros.
for(_t=St.length;!St[--_t];);// E.g. [4, 11, 15] becomes 4bf.
for(It=0,pt="";It<=_t;pt+=Pe.charAt(St[It++]));pt=he(pt,yt)}// The caller will add the sign.
return pt}