## flip(a)  Flip the first two arguments of a functions arguments.
346067
function flip(f) {
    return curry(function(a, b) {
        var args = rest(arguments).slice(2);

        return f.apply(null, [b, a].concat(args));
    });
}
1278337
private void swapVals(int e, int f, int[] vals) {
        int vals_e = vals[e];
        vals[e] = vals[f];
        vals[f] = vals_e;
    }
1104493
function splitArgsIntoOptionsAndCallback (args) {
  let params;
  let options;
  let cb;
  if (args.length > 1) {
    const possibleCb = args[args.length - 1];
    if ('function' === typeof possibleCb) {
      cb = possibleCb;
      options = args.length === 3 ? args[1] : undefined;
    } else {
      options = args[1];
    }
    params = args[0];
  } else if ('object' === typeof args[0]) {
    params = args[0];
  } else if ('function' === typeof args[0]) {
    cb = args[0];
  }
  return { params, options, cb };
}
87934
function (arg1, arg2) {
    if (typeof arg1 !== 'string') throw 'First argument of param function must be a param name string.';
    if (typeof arg2 !== 'function') throw 'Second argument of param function must be a function.';
    
    _params.push({
      name: arg1,
      handler: arg2
    });
  }
520416
function(arr, func, obj, func2){
					var big = [obj, func2];
					each(arr, function(i, item){
						big.unshift(item, func)
					});
					when.apply(steal, big);
				}
1130434
def Then2(self, f, arg1, *args, **kwargs):
        
        args = (arg1,) + args
        return self.ThenAt(2, f, *args, **kwargs)
494864
function FlipX (opts) {
    FlipX.superclass.constructor.call(this, opts)
    this.flipX = opts.flipX
}
1321661
def _arg2opt(arg):
    '''
    
    '''
    res = [o for o, a in option_toggles.items() if a == arg]
    res += [o for o, a in option_flags.items() if a == arg]
    return res[0] if res else None
1261095
public static int[] flip(int[] src, int[] dest, final int start, final int length)
	{
		if (dest == null || dest.length < length)
			dest = new int[length];

		int srcIndex = start + length;
		for (int i = 0; i < length; i++)
		{
			dest[i] = src[--srcIndex];
		}

		return dest;
	}
1060317
function foldR(fn, startValue, list) {
      
   return list 
            ? fn(foldR(fn, startValue, tail(list)), head(list))
            : startValue
            ;
}
769336
def _process_arguments(self, arguments):
        
        if not arguments:
            return None
        a = arguments.split(" :", 1)
        arglist = a[0].split()
        if len(a) == 2:
            arglist.append(a[1])
        return arglist
258425
private static int flipArray(char [] dest, int start, int e, int w){
        int r;
        if (w > start) {
        // shift, assume small buffer size so don't use arraycopy
          r = w;
          w = start;
          while (r < e) {
            dest[w++] = dest[r++];
           }
         } else {
             w = e;
         }
        return w;
      }
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;
	}
209278
@SuppressWarnings("unchecked")
	public static <T> T[] flip(final T[] src)
	{
		final int length = src.length;

		return flip(src, (T[]) Array.newInstance(src.getClass().getComponentType(), length), 0, length);
	}
1321837
def dummy_func(arg1, arg2, arg3=None, arg4=[1, 2, 3], arg5={}, **kwargs):
    
    foo = kwargs.get('foo', None)
    bar = kwargs.pop('bar', 4)
    foo2 = kwargs['foo2']
    foobar = str(foo) + str(bar) + str(foo2)
    return foobar
1273083
function flip(o) {
    var flipped = { };
    for (var i in o) {
        if (o.hasOwnProperty(i)) {
            flipped[o[i]] = i;
        }
    }
    return flipped;
}
1368670
def bit_flip_operators(p):
    
    k0 = np.sqrt(1 - p) * I
    k1 = np.sqrt(p) * X
    return k0, k1