As his administration comes to its end, President Obama is effectively calling into question the results of the 2016 race by demanding a full accounting of Russian intrusions into our electoral process. But The New York Times tells us the president knew about the political hacks in July.

So now that the barn door is closed, Obama wants to let the horses out, presumably to trample on the public’s perceived legitimacy of the Trump victory. Yet when he actually had the chance to act against the hacking itself, Obama did … nothing.

Which is reminiscent of the time back in 2014 when Russia invaded Ukraine and seized territory and he did … nothing.

Which reminds me of the time when Syria used chemical weapons against its own people in 2013 and thus crossed a “red line” Obama himself had drawn that required a military response, and Obama did … nothing.

Or how about after the fall of Moammar Khadafy in Libya in 2011, which led to the country turning into a sinkhole that eventually swallowed up the four Americans killed at Benghazi, when Obama did … nothing?

Perhaps you remember when the Iranian government stole the 2009 election and hundreds of thousands of Iranians took to the streets and Obama did . . . nothing?

The consistency with which Barack Obama has spent his presidency refusing to respond to international provocations, evils and specific threats against the United States is no accident. It constitutes one of the prevailing foreign-policy motifs of the past eight years. Call it the Underreaction Doctrine.

The Underreaction Doctrine binds all these shameful examples of willful blindness to some of the historically unforgivable policy positions of the Obama administration. There was, of course, the president’s own declaration that ISIS was a “jayvee” team and therefore unworthy of concern.

This jayvee team was basically impelled into existence by two other underreactions. First was the punting of the administration on the status-of-forces agreement with Iraq in 2011 that led to the complete withdrawal of American forces — which was deemed to be just fine because Iraq needed to stand on its own anyway.

Second was the uprising against the Bashar al-Assad regime in Syria that led to a flurry of internal Obama administration policy proposals the president basically ignored.

Taken together, both of these underreactions created the power vacuum in Syria and Iraq that was filled by the recreated remnant of the terror group al Qaeda in Iraq, which transmuted into the Islamic State, which became the first such group to hold and administer territory in the nightmare caliphate of its own evil invention.

Most egregious, perhaps, has been the underreaction to radical Islamic terrorism on our own soil. An Islamist Army doctor under the sway of a radical cleric shoots up Fort Hood in 2009 and the administration calls it a workplace incident.

The Tsarnaev brothers ignite bombs at the Boston Marathon and the president declines to mention their extremist religious ideology as the determining factor in their actions. Omar Mateen massacred dozens at the Pulse nightclub in Orlando, all the while telling the 911 operator on the phone that he was acting in the name of ISIS and the administration contended it had no idea what had motivated him.

As these incidents demonstrated, the underreaction was the reaction — for if the president were to acknowledge the existence of a homegrown Islamist threat, it would require him to do more than counsel us against the sin of Islamophobia.

As with Islamism at home, so with provocations abroad. The president has underreacted as a deliberate form of policymaking. He has used it to signal the Russians and the Iranians and others that their provocations would not deter him from making deals with them. Quite the opposite, in fact.

Obama didn’t do anything when each of these events happened — and now he wants to punish . . . Trump, by basically delegitimizing the president-elect over the Russia hacks.

The Underreaction Doctrine was a way of letting the world know that America under his authority would try not to cast its shadow upon the world.

And so the world has cast its shadow upon us instead.