code: func CalcDifficulty(snap *Snapshot, signer common.Address) *big.Int {
  	if snap.inturn(snap.Number+1, signer) {
  		return new(big.Int).Set(diffInTurn)
  	}
  	return new(big.Int).Set(diffNoTurn)
  }
docs: // CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty
  // that a new block should have based on the previous blocks in the chain and the
  // current signer.