Generic thunk-based "trampoline" helper function.

@param {Function} input function
@return {Function} "trampolined" function
@api private
175101
function trampoline (fn) {
  return function () {
    var result = fn.apply(this, arguments);

    while ('function' == typeof result) {
      result = result();
    }

    return result;
  };
}
386065
function _animateFunc(func, element, duration, opts) {
  opts = Object.assign({}, opts);
  var tween;
  return new Promise(function(resolve, reject, onCancel) {
    opts.onComplete = resolve;
    tween = func(element, duration, opts);
    onCancel &&
      onCancel(function() {
        tween.kill();
      });
  });
}
159730
function paddLeft(str, length, what) {
	if (length <= str.length) {
		return str.substring(0, length);
	}
	what = what || ' ';
	return what.repeat(length - str.length) + str;
}
817237
function getJump(from, toJump) {
    if (from < toJump) return toJump + 1;else if (from > toJump) return toJump - 1;else return toJump;
}
1206569
function(input) {
    return input.replace(/\{{2,}/g, function(match) {
      return match.length > 2 ? match.substr(2) : '<%=';
    }).replace(/\}{2,}/g, function(match) {
      return match.length > 2 ? match.substr(2) : '%>';
    });
  }
1345724
function createFlipperModel (setRotationDegrees, onFlip) {
  // XXX: A lot of mutable variables here!!!
  //      If you are up for a challenge, please help clean up this code!

  // Current rotation to be rendered (degrees)
  let current = 0

  // Target rotation (degrees)
  let target = 0

  // Current rotation speed (degrees/frame)
  let currentSpeed = 0

  // Spring strength
  const springK = 1 / 15

  // Rotation acceleration (degrees/frame^2)
  const acceleration = 0.7

  // Animation parameters...
  let animationActive = false
  let animationStartTime = Date.now()
  let lastFrameNumber = 0

  // State of dragging
  let pointerIsDown = false
  let history = [ ]

  // Returns whether an animation should run.
  function shouldAnimate () {
    // Don’t animate while dragging
    if (pointerIsDown) return false

    const finished = current === target && Math.abs(currentSpeed) < 0.5
    return !finished
  }

  // Ensure that animation frame is requested (if an animation is needed).
  function updateAnimation () {
    if (!animationActive && shouldAnimate()) {
      animationStartTime = Date.now()
      lastFrameNumber = 0
      window.requestAnimationFrame(frame)
      animationActive = true
    }
  }

  // The animation frame. Calls update (handle frameskip) and draw.
  function frame () {
    if (!animationActive) return
    const expectedFrameNumber = (Date.now() - animationStartTime) / 1000 * 60
    const updateCount = Math.min(expectedFrameNumber - lastFrameNumber, 10)
    lastFrameNumber = expectedFrameNumber
    for (let i = 0; i < updateCount; i++) {
      update()
      if (!shouldAnimate()) {
        animationActive = false
        break
      }
    }
    draw()
    if (animationActive) {
      window.requestAnimationFrame(frame)
    }
  }

  // Animation update logic.
  function update () {
    const bestSpeed = (target - current) * springK
    currentSpeed = linearlyApproach(currentSpeed, bestSpeed, acceleration)
    current += currentSpeed
    if (Math.abs(current - target) < 0.1) {
      current = target
    }
  }

  // Linearly approach target by at most delta.
  function linearlyApproach (current, target, delta) {
    if (Math.abs(current - target) < delta) {
      return target
    } else if (current < target) {
      return current + delta
    } else {
      return current - delta
    }
  }

  // Animation draw logic.
  function draw () {
    setRotationDegrees(current)
  }

  // Based on current animation state, simulate the projected rotation angle
  // if we allow the spinning to stop without intervention.
  function getProjection () {
    let projection = current
    let speed = currentSpeed
    for (let i = 0; i < 600; i++) {
      const targetSpeed = speed * (1 - springK)
      speed = linearlyApproach(speed, targetSpeed, acceleration)
      projection += speed
    }
    return projection
  }

  // Based on the animation target angle, are we showing the back side?
  function isFlipped (angle) {
    return Math.round(angle / 180) % 2 !== 0
  }

  // Flips the flipper (if necessary).
  //
  // - `flipped` Set to true to display the backside or false for front side.
  function flip (flipped) {
    const projection = getProjection()
    target = getTargetAngle(projection, flipped)
    updateAnimation()
  }

  // Based on the projected angle `projection` and desired `flipped` state,
  // determine the optimal angle to rotate the flipper to.
  function getTargetAngle (projection, flipped) {
    const offset = flipped ? 180 : 0
    return Math.round((projection - offset - 1) / 360) * 360 + offset
  }

  // Queue a draw frame (for use when animation is not active).
  let pendingDraw = false
  function queueDraw () {
    if (pendingDraw) return
    pendingDraw = true
    window.requestAnimationFrame(() => {
      pendingDraw = false
      draw()
    })
  }

  return {
    setFlipped (flipped) {
      flip(flipped)
    },
    pointerDown () {
      pointerIsDown = true
      history.length = 0
      history.push({ time: Date.now(), current })
    },
    pointerMove (delta) {
      current += delta
      queueDraw()

      // Maintain a brief history of dragging to calculate the ending drag speed.
      history.push({ time: Date.now(), current })
      while (history.length > 1 && history[0].time < Date.now() - 100) {
        history.shift()
      }
    },
    pointerUp () {
      pointerIsDown = false

      // Set the rotation speed to the ending speed of dragging.
      if (history.length > 0) {
        const dt = (Date.now() - history[0].time) / 1000 * 60
        const dx = current - history[0].current
        const dragSpeed = Math.max(-25, Math.min(25, dx / dt))
        currentSpeed = dragSpeed
      }

      // Signal the flipping intent.
      const projection = getProjection()
      if (Math.abs(projection - target) > 90) {
        onFlip(!isFlipped(target))
      }
      updateAnimation()
    }
  }
}
160881
function tap(nextOrObserver, error, complete) {
    return function tapOperatorFunction(source) {
        return source.lift(new DoOperator(nextOrObserver, error, complete));
    };
}
672440
function( input, null_text ) {
		if ( input == null || input === undefined ) return null_text || '';
		if ( typeof input === 'object' && Object.prototype.toString.call(input) === '[object Date]' ) return input.toDateString();
		if ( input.toString ) return input.toString().replace(/\n/g, '<br />').replace(/''/g, "'");
		return '';
	}
324293
def _trampoline(name, module, *args, **kwargs):
    
    function = _function_lookup(name, module)

    return function(*args, **kwargs)
1141269
async function cancel(input, reason) {
  if (isStream(input) && input.cancel) {
    return input.cancel(reason);
  }
}
102236
function stringular(input) {
  var args = Array.prototype.slice.call(arguments, 1);

  return input.replace(/{(\d+)}/g, function (match, number) {
    return isUndefined(args[number]) ? match : args[number];
  });

}
351520
function stringify(input) {
				if (typeof input === 'string') {
					return input;
				}

				if (!input) {
					return '';
				}

				output = input.m;

				var variations = [];
				for (var key in input) {
					if (input.hasOwnProperty(key) && key !== 'm') {
						// Only show variations that are not the primary one, since
						// primary variations are chosen by default
						if (input[key] > 0) {
							if (verbose) {
								variations.push(', variation ' + input[key] + ' at move ' + key);
							} else {
								variations.push('-' + key + ':' + input[key]);
							}
						}
					}
				}

				output += variations.join('');
				return output;
			}
1356608
function(keysFunc, undefinedOnly) {
    return function(obj) {
      var length = arguments.length;
      if (length < 2 || obj === null) return obj;
      for (var index = 1; index < length; index++) {
        var source = arguments[index];
        var keys = keysFunc(source);
        var l = keys.length;

        for (var i = 0; i < l; i++) {
          var key = keys[i];
          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
        }
      }

      return obj;
    };
  }
173113
function morph (value, input) {
  const result = input || readable()
  const cb = map[type(value)] || end
  cb(result, value)
  return new Proxy(result, {
    get(target, key, receiver) {
      if (key !== 'pipe') return target[key]
      return function (dest) {
        pump(result, dest)
        return dest
      }
    }
  })
}
1272356
function(input) {
    // Deny RETURN unless the command might work
    if (this.requisition.status !== Status.VALID) {
      return Promise.resolve(false);
    }

    this.terminal.history.add(input);
    this.terminal.unsetChoice().catch(util.errorHandler);

    this.terminal._previousValue = this.terminal.inputElement.value;
    this.terminal.inputElement.value = '';

    return this.requisition.exec().then(function() {
      this.textChanged();
      return true;
    }.bind(this));
  }
434456
function(input, output) {
		rxAnimation.lastIndex = 0;

		var animation;
		var rawKeyframes;
		var keyframe;
		var curAnimation;

		while((animation = rxAnimation.exec(input)) !== null) {
			//Grab the keyframes inside this animation.
			rxKeyframes.lastIndex = rxAnimation.lastIndex;
			rawKeyframes = rxKeyframes.exec(input);

			//Grab the single keyframes with their CSS properties.
			rxSingleKeyframe.lastIndex = 0;

			//Save the animation in an object using it's name as key.
			curAnimation = output[animation[1]] = {};

			while((keyframe = rxSingleKeyframe.exec(rawKeyframes[1])) !== null) {
				//Put all keyframes inside the animation using the keyframe (like botttom-top, or 100) as key
				//and the properties as value (just the raw string, newline stripped).
				curAnimation[keyframe[1]] = keyframe[2].replace(/[\n\r\t]/g, '');
			}
		}
	}
830276
function traverse (input, strict) {
  if (strict === undefined) strict = true;

  if (is.object(input)) return object(input, strict);
  if (is.array(input)) return array(input, strict);
  return input;
}