While the national Democratic Party is undergoing major soul-searching after Donald Trump's upset election over Hillary Clinton, the Philadelphia machine keeps chugging along despite one corruption scandal after another.

Consider some recent lowlights: U.S. Rep. Chaka Fattah was sentenced earlier this month to 10 years in prison on corruption charges that included bribery, racketeering, money laundering, bank fraud, mail and wire fraud, and filing false statements.

Two Philadelphia judges were kicked off the bench last week for their roles in separate case-fixing schemes as part of a broader probe that ensnared two other Municipal Court judges.

That's not to be confused with the nine Traffic Court judges who were charged in 2013 after yet another investigation into ticket-fixing. One judge was acquitted, but the others were either convicted or pleaded guilty. Traffic Court has since been abolished. But electing judges - which requires fund-raising, largely from lawyers who then appear before the judges - is a bad idea and one where the Democratic machine wields undue influence in Philadelphia.

The city's tolerance for corruption runs so high that last month voters reelected State Rep. Leslie Acosta after she had pleaded guilty to one felony count of conspiracy to commit money laundering. Fortunately, Acosta plans to resign next month, but likely will be replaced by another Democratic Party lackey.

In a one-party town, no bad deed seems to slow the machine. Even if a Democratic pol gets busted, the party just plugs in another hack and goes about its business. Of course, the Republicans share the blame for their failure to put forth credible candidates, let alone even a warm body.

Take State Sen. Larry Farnese, a Democrat who represents South Philadelphia. He was indicted in May. Farnese, who is awaiting trial, was reelected in November after running unopposed.

It gets better. Farnese's defense attorney said in a court filing that what prosecutors call a bribe was really a "legitimate campaign expenditure." You be the judge.

According to the 13-count indictment, Farnese used $6,000 in campaign funds to pay the tuition for a study-abroad program for a former Democratic committee chairwoman's daughter. The funds were used to secure former Chairwoman Ellen Chapman's vote for Farnese as leader of Philadelphia's Eighth Ward, the indictment said, and the payment was concealed on campaign-finance reports as a donation to a scholarship fund.

In another court filing, Farnese's attorney said that what federal prosecutors call a bribe is just "routine party politicking." That may be the case when it comes to Democratic politics in South Philadelphia. After all, the two previous state senators who held Farnese's seat went to prison.

Apparently taking bribes was routine for some Democratic state representatives in Philadelphia. Former State Reps. Michelle Brownlee, Harold James, and Ronald Waters pleaded guilty to taking bribes as part of the sting that also ensnared former State Rep. Louise Bishop, who pleaded no contest to failing to report $1,500 she took. A fifth state representative, Vanessa Lowery Brown, is contesting similar charges.

In an "only in Philly" twist, the person who prosecuted the five state representatives is District Attorney Seth Williams, a Democrat who, yep, is under federal investigation over the use of campaign funds. He has not been charged.

The feds are also investigating City Councilman Bobby Henon, a Democrat who is also a paid leader of the Electricians' Union Local 98. Henon's City Hall office was raided in August as part of a sweeping probe of the powerful union and its leader, John Dougherty. Investigators are reportedly looking into the union's finances and its involvement in political campaigns. The union was a major backer of Jim Kenney's winning mayoral bid in November 2015 as well as the election of Dougherty's brother, Kevin, to the state Supreme Court. No one has been charged in the union probe.

Likewise, no charges were filed against an assistant city solicitor, Duncan Lloyd, who was caught on tape taking photos of a second man who spray painted "F- Trump" on the wall of newly opened Fresh Market in Chestnut Hill.

Mayor Kenney called the vandalism a "dumb mistake." Perhaps, in the scheme of things. But it is also the type of government arrogance - combined with years of Democratic corruption, inefficiency, waste, and entitlement like DROP payments - that makes voters crazy enough to support a dangerous demagogue like Trump.

The machine is safe for now in Philadelphia, where Democrats outnumber Republicans, 8-1. But nothing is certain these days with Trump moving into the White House and Republicans in control of the House and Senate in Washington.

Republicans also control the legislature in Harrisburg. That leaves Philadelphia as an island of blue in a state that is largely red. Given that Pennsylvania is a key to future White House races, Philadelphia could become a focal point for Trump and his Russian plumbers.

The Democratic machine - led by longtime party boss Bob Brady - would be wise to focus on serving taxpayers rather than the party apparatchiks. It is not only good politics, but good for the city's long-term survival.

Paul Davies is the deputy editorial page editor of the Inquirer. pdavies@phillynews.com