Amy Poehler as Leslie Knope and Adam Scott as Ben Wyatt in the final episode of “Parks and Recreation.” (Colleen Hayes/NBC)

Tonight, we say goodbye to “Parks and Recreation,” the remarkably humane NBC sitcom about Leslie Knope (Amy Poehler), a hyper-competent and incredibly enthusiastic public servant, which managed to hang on for seven seasons in a show of persistence worthy of its optimistic heroine. “Parks” is a beautiful testament to the power of friendship, a quietly consistent argument for feminism and a comedy machine on par with “The Simpsons.” But it’s also a sustained, deep argument for a kind of confident liberalism that is almost entirely absent from other pop culture and that sometimes seems under threat in real-world politics.

“Parks and Recreation” stood out in an exceptionally cynical era of politics for its celebration of a level of government where, as Amy Poehler put it to The Post in 2012, “there are a lot of different people working together that have very different views and find a way to do it.” But if the show had only been a shallow call for bipartisanship, it might have been as naive as the supposedly cynical “House of Cards” has proved to be, and as dull as the sort of political speechifying “Parks” so regularly transcended.

Instead, “Parks and Recreation” distinguished itself from other television that’s broadly considered liberal (and from so much of real-world politics), by arguing for a theory of change and a specific role for government.

Leslie Knope’s first major campaign, to get the pit outside her friend Ann’s house filled and turned into a park, was a long and sometimes exhausting effort. In the second season, impatient with the political and bureaucratic hurdles to this incredibly modest goal, Leslie tried to circumvent the process by hiring private builders who accidentally hurt her friend Andy. Later, she tried turning a tiny traffic island into a park to assure herself that she was making progress.

But as frustrating as the process could be, Leslie regularly recommitted to the idea that she would accomplish more by working with the people who stood in her way and bringing them on board. That way might take longer, and it might require more of Leslie and everyone else who advocates for change. But “Parks” constantly argued that Leslie would gain more by bringing even the most recalcitrant adversary on board if at all possible. She even rescued her longtime enemy, the cynical, obstructionist, self-interested city counselor and dentist Jeremy Jamm (Jon Glaser) from the clutches of the man-eating Tammy Two (Megan Mullally).

Leslie brought this persistent style and her obsessive work ethic to everything from throwing an epic Harvest Festival, fighting a government shutdown and advocating for the Pawnee Sanitation Department to start hiring women. If there was a consistent theme to her biggest fights, though, it was that government has an obligation to stand up for the right of citizens to govern their communities when corporations try to hold them hostage.

The fourth season of “Parks and Recreation” was dominated by Leslie’s run for city council against Bobby Newport (Paul Rudd), the scion of Sweetums, a corporation that has lulled Pawnee into sleepiness with plentiful jobs and astonishing volumes of sugar. During the campaign’s debate, Bobby delivered what he thought was a knockout line, telling the audience that if Leslie won the race, Sweetums would leave town. In response, Leslie delivered a closing statement that defines the “Parks and Recreation” philosophy better than almost anything else that happened in the show.

“I am very angry. I’m angry that Bobby Newport would hold this town hostage and threaten to leave if you don’t give him what he wants. . . . Corporations are not allowed to dictate what a city needs. That power belongs to the people,” Leslie insisted. “I love this town. And when you love something, you don’t threaten it. You don’t punish it. You fight for it. You take care of it. You put it first.”

This year, Leslie applied her beliefs that you can find solutions that work for everyone and that corporations can’t be allowed to take over towns to her fight with Gryzzl, a Google-like company with hipster leadership and a casual attitude toward its customers’ privacy. When Gryzzl buys a large parcel of land, planning to use it for a new headquarters, Leslie, now an official with the National Parks Service, persuades the company to donate the plot to be used for a park and to build its new offices in an economically depressed part of town.

These deep considerations of the role of government would have made “Parks and Recreation” strikingly more sophisticated than almost any other competitor, especially at a moment when pop culture’s politics are often judged merely on diversity rather than ideas. But “Parks” excelled on that score, too, giving us an astonishingly textured world populated by characters who defied stereotypes of all sorts.

The Pawnee of “Parks” included the magnificent Donna Meagle (Retta), who sang opera, treated herself and ended up marrying a sweet schoolteacher (Keegan-Michael Key) who was her complete opposite, as well as Perd Hapley (Jay Jackson), the town’s hilariously literal and slightly dim news anchor. Tom Haverford (Aziz Ansari), the luxury-obsessed civil servant who achieved his dreams of owning a small business (if not at the baller scale he initially imagined), was a brilliant rejection of tropes of over-achieving Indian Americans.

Pawnee didn’t just have the gay penguins whose wedding Leslie presided over in the show’s second season, but also Derek (Blake Lee) and Ben (Josh Duvendeck), April Ludgate’s (Aubrey Plaza) two gay boyfriends.

“Parks” even gave us Ken Hotate (Jonathan Joss), the leader of Pawnee’s Wamapoke tribe, one of exceptionally few Native American characters in pop culture and the most genial race-baiter to ever appear on American television. (“I know two things about white people,” he explained after putting a fake hex on Leslie’s Harvest Festival as a negotiating tactic in a dispute. “They love Rachael Ray. And they are terrified of curses.”

“Parks and Recreation” didn’t have to wait for the rest of media to catch up to play with the representations of gay people or people of color. It just went ahead and created its own weird, wonderful and radically equal vision of what the world can be like. And “Parks and Recreation’s” commitment to diversity was no mere matter of social position. It was an expression of curiosity that helped create an exceptionally vivid fictional town and gave the show’s writers a huge raft of comedic material to work from.

And in keeping with the show’s confident liberalism, Leslie Knope’s enduring friendship with Ron Swanson (Nick Offerman) wasn’t merely a way for Leslie to demonstrate that she was tolerant enough to have a libertarian in her life, or as proof that brown liquor and breakfast food are the only two truly non-partisan things in America. While the two characters had wildly different visions of the best way to make the world a better place, “Parks and Recreation” didn’t just respect Ron’s position as an expression of principle; it found real value in the ways he lived his life.

Ron’s deep knowledge and self-reliance mean he’s the kind of person who can climb a television pole to restore television service to a debate party, preserve the art of woodworking and quietly serve as a terrific manager and mentor to young talent. “Parks and Recreation” has always been the kind of show to find humor in laziness and incompetence, rather than to excoriate the people who exhibit it as drags on society. But Ron’s belief in self-reliance did stand in stark and admirable contrast to the loafing and dependence of some of his neighbors. Ron could be stubborn to a fault, as when he insists on excluding girls from the Pawnee Rangers scouting troop. But after Leslie woos all his scouts away with candy and the promise that they don’t have to camp under tarps, she founded the Swansons, a troop dedicated to scouts of both genders who embrace Ron’s hard-core ethos.

The liberalism “Parks and Recreation” advocated with such warmth and humor for seven seasons can stand up to opposing ideas and worldviews with confidence and charm. Leslie Knope has never needed to eradicate Ron Swanson’s libertarianism, the evangelical censoriousness of family values scold Marcia Langman (Darlene Hunt) or the sticky-sweet corporate irresponsibility of Sweetums. Fighting a constant battle of ideas with all of them has made her a better, sharper, smarter public servant.