Flips a coin a number of times.

    Syntax: {command} [number]
183640
def cmd(send, msg, _):
    
    coin = ['heads', 'tails']
    if not msg:
        send('The coin lands on... %s' % choice(coin))
    elif not msg.lstrip('-').isdigit():
        send("Not A Valid Positive Integer.")
    else:
        msg = int(msg)
        if msg < 0:
            send("Negative Flipping requires the (optional) quantum coprocessor.")
            return
        headflips = randint(0, msg)
        tailflips = msg - headflips
        send('The coins land on heads %g times and on tails %g times.' % (headflips, tailflips))
618043
function flip(obj) {
              var newObj = Object.create(null),
                  key;

              for (key in obj) {
                newObj[obj[key]] = key;
              }

              return newObj;
            }
363420
@Override
	public void flipBit(int index) {
		index = adjIndex(index);
		checkMutability();
		bits[index] = !bits[index];
	}
799844
function roundToNumber(num, place) {
    var newval=1*num;

    if(typeof(newval)=="number"){
      if(place<=0){
        var roundVal=-place;
        newval= +(Math.round(newval + "e+" + roundVal) + "e-" + roundVal);
      }
      else {
        var roundVal=place;
        var divval= "1e+"+roundVal;
        newval= +(Math.round(newval/divval))*divval;
      }
    }
    return(newval);
}
814211
function flip(input){
		input = input.reverse();
		
		// Flip any options back into the right order
		for(let i = 0, l = input.length; i < l; ++i){
			const arg = input[i];
			const opt = shortNames[arg] || longNames[arg];
			
			if(opt){
				const from    = Math.max(0, i - opt.arity);
				const to      = i + 1;
				const extract = input.slice(from, to).reverse();
				input.splice(from, extract.length, ...extract);
			}
		}
		
		return input;
	}
35529
def flipSNPs(inPrefix, outPrefix, flipFileName):
    """"""
    plinkCommand = ["plink", "--noweb", "--bfile", inPrefix, "--flip",
                    flipFileName, "--make-bed", "--out", outPrefix]
    runCommand(plinkCommand)
483673
function n2bts(n_) {
  var neg = n_ < 0;
  var n = Math.abs(n_);
  var s = '';
  do {
    var digit = n % 3;

    // balance the ternary http://stackoverflow.com/questions/26456597/how-to-convert-from-unbalanced-to-balanced-ternary
    if (digit === 2) {
      digit = -1;
      ++n;
    }

    //console.log('digit',digit,n,n_,s);

    // if number has negative sign, flip all digits
    if (neg) {
      digit = -digit;
    }

    s = N_TO_BT_DIGIT[digit] + s;
    n = ~~(n / 3);    // truncate, not floor! negatives

  } while(n);
  //console.log('n2bts',n_,s);
  return s;
}
942146
function( r, revert ) {
        var rX = " rotateX(" + r.x + "deg) ",
            rY = " rotateY(" + r.y + "deg) ",
            rZ = " rotateZ(" + r.z + "deg) ";

        return revert ? rZ + rY + rX : rX + rY + rZ;
    }
228925
function generateNumber(beginValue, endValue, duration, easing, interval){
  verifyParams(duration, interval)
  const count = duration / interval
  const times = endValue - beginValue
  const numbers = generate(easing, count, times).map(number => (number + beginValue).toFixed(4))
  return numbers
}
1316049
function random (utxos, outputs, feeRate) {
  utxos = shuffle(utxos)

  return accumulative(utxos, outputs, feeRate)
}
676016
public static int flip(int i) {
		int result = 0;
		result |= (i & 0xFF) << 24;
		result |= (i & 0xFF00) << 8;
		result |= ((i & 0xFF0000) >> 8) & 0xFF00;
		result |= ((i & 0xFF000000) >> 24) & 0xFF;
		return result;
	}
1373276
def _make_win(n, mono=False):
    

    if mono:
        win = np.hanning(n) + 0.00001
    else:
        win = np.array([np.hanning(n) + 0.00001, np.hanning(n) + 0.00001])
    win = np.transpose(win)
    return win
1209705
function bintodecoutput(bin){
  var len = bin.length;
  var decoutput = String();
  var work = new Array(len);
  var outputlen = 0;
  for(var i=0; i<len; i++){work[i] = bin[i];}
  while(len){
    // as long as a remaining value exists
    var lead = false;
    var bit0;
    var bit1;
    var bit2;
    var bit3;
    var value;
    var i = 0;
    while(i < len-3){
      // walk through the remaining value
      bit0 = work[i+3];
      bit1 = work[i+2];
      bit2 = work[i+1];
      bit3 = work[i+0];
      value = (bit3<<3) | (bit2<<2) | (bit1<<1) | (bit0<<0);
      if(value >= 10){
        // For nibbles greaterequal than 10, adjust the bits accordingly.
        work[i+0] = true; work[i+1] = bit2 && bit1; work[i+2] = !bit1;
      }else{
        work[i+0] = lead;
        if(lead){
          // When the previous nibble was 8 or 9, adjust the bits accordingly
          work[i+1] = !bit1; work[i+2] = !bit1;
          lead = bit1;
        }else{
          // otherwise, just leave the bits as they are.
          if(value >= 8){lead = true;}
        }
      }
      i++;
    }
    // extract the decimal value of the remaining bits
    if(len==1){
      bit0 = work[0];
      bit1 = false;
      bit2 = false;
    }else if(len==2){
      bit0 = work[1];
      bit1 = work[0];
      bit2 = false;
    }else{
      bit0 = work[i + 2];
      bit1 = work[i + 1];
      bit2 = work[i + 0];
    }
    bit3 = lead;
    var value = (bit3<<3) | (bit2<<2) | (bit1<<1) | (bit0<<0);
    if(!(outputlen%3)){decoutput = ' ' + decoutput;}
    decoutput = value + decoutput;
    outputlen++;
    len = i;
  }
  // Remove zeros
  var i = 0;
  outputlen = decoutput.length;
  while((i < outputlen) && ((decoutput[i] == '0') || (decoutput[i] == ' '))){i++;}
  if(i == outputlen){
    return "0";
  }else{
    return decoutput.slice(i);
  }
}
222136
function flip(fn) {
  return function() {
    var first = arguments[0];
    var second = arguments[1];
    var rest = [].slice.call(arguments, 2);
    return fn.apply(this, [second, first].concat(rest));
  };
}
695038
def transition(value, maximum, start, end):
    
    return round(start + (end - start) * value / maximum, 2)
706526
def cmd(send, msg, args):
    
    if not msg:
        send("Choose what?")
        return
    choices = msg.split(' or ')
    action = [
        'draws a slip of paper from a hat and gets...', 'says eenie, menie, miney, moe and chooses...', 'picks a random number and gets...',
        'rolls dice and gets...', 'asks a random person and gets...', 'plays rock, paper, scissors, lizard, spock and gets...'
    ]
    send("%s %s" % (choice(action), choice(choices)), 'action')
231636
def command=(com)

      com = com.is_a?(Array) ? com : com.split(' ')
      com = [ com.first, com.last ]
      com[1] = com[1].to_i if com[1] and com[0] != 'jump'

      h.fields['__command__'] = com
    end