Oracle Arena has been home to the Warriors since 1966. (Thearon W. Henderson/Getty Images)

Inside Tooned Studios, Stanley Cox works through a song. Right now, he is rapper Mistah F.A.B., and he’s grinding, trying to get the hook just right. For more than an hour, he tries to marry the perfect words with the music, revising, ad-libbing, listening to producer input, scrutinizing every word. The artist stops on this Thursday morning only to talk about two other passions: his hometown of Oakland and the world-renowned basketball team that represents the city, for at least a few more days, the Golden State Warriors.

“We’ve created a tourist attraction with our basketball team,” said Cox, who is also a ­37-year-old activist, community organizer and owner of the Dope Era clothing store in downtown Oakland. “Without the Warriors, man, so many good things in the city of Oakland would have never happened — not just the pride they’ve given us, but the money they’ve put into projects in the community, the role models they’ve provided, how they’ve shown some of our young athletes what’s possible.”

These are exciting times with the Warriors vying to bring “The Town” a fourth championship in five seasons. These are tense times with the team hobbled and struggling to counter the Toronto Raptors. But most of all, these are bittersweet times with the team slated to depart Oakland and journey across the Bay Bridge to San Francisco, where it will start playing in the new, billion-dollar Chase Center next season. While it’s just about an 11-mile trek, it will feel like a much more significant relocation.

As the Warriors have risen from the dirt and enjoyed one of the greatest runs in NBA history, the international spotlight has helped to brand Oakland as something greater than a dangerous, crime-ridden city. The glamour of the Warriors allows many to see the beauty of Oakland. And the grit of the Warriors allows many to appreciate the resolve of Oakland. In that way, it has been an ideal relationship. For all the East Bay fans who suffered through decades of losing and still created an almost unrivaled atmosphere at Oracle Arena, the timing couldn’t be worse.

The Warriors are careful to explain that they won’t stop having an impact on Oakland. Rick Welts, Golden State’s president and chief operating officer, says it often: “The Warriors are leaving the building, but we’re not leaving the city.”

There is plenty of evidence of those intentions, including the franchise’s decision to convert its downtown practice facility into a community and health center as well as offices for nonprofit endeavors. They aren’t bungling this move the way most sports organizations do. Still, there is sadness. And there will be a void.

“I feel like it’s a time of reflection, but with another championship in their last year here, it’s about securing a legacy,” Cox said. “This franchise went from the mud to being arguably one of the three greatest NBA teams ever. Just take it in and know that there probably won’t be another team like this for a long time. These moments are very precious to the city, and this last one would be a lot more sweeter because at least we could say we rode off on our high horse.”

You would expect most Oakland residents to be bitter or overwhelmed with all the transition in their local sports. The Raiders plan to move to Las Vegas in 2020, and they’re amid an ugly and litigious fight with Oakland. The Athletics have been a threat to move for more than a decade, but they are now focusing on a proposal to build a new ballpark near Jack London Square.

The business of sports is never fun. Teams preach about their value as civic assets, their pride in representing the city, and then they put that very thing up for sale when it suits their financial interests. It’s cruel. It can be a turnoff. But while fans here have so many mixed emotions, it’s also fascinating that they are quite pragmatic about it all, more than most cities would be.

That’s Oakland. The people are real. You can’t B.S. them.

“We get it,” Marcus Baldwin, 52, said after having breakfast Friday at the Oakland Grill. “There’s a lot of money and opportunity in San Francisco. It’s sad. It makes me angry at times. But you can’t tell a business not to be a business.”

Over the years, I have made many trips to the Bay Area, and if at all possible, I try to stay in Oakland. I like the vibe, the diversity. The city doesn’t overwhelm you like San Francisco can. If you know where to go, it’s a fun place to spend a few days.

But I hadn’t driven through most of the city until this week. To feel its soul, I ventured away from downtown, from Jack London Square, from Lake Merritt, and went to neighborhoods to the east, west and north. I didn’t shy away from the raw side of Oakland and got a greater feel for the infrastructure needs, lack of funding for education, poverty and crime.

For certain, the city has a long way to go, so long that it may never get there. But it wasn’t frightening. It was inspiring to witness the loyalty of the natives. Whether it’s Marshawn Lynch, Gary Payton or Damian Lillard — whether it’s rapper E-40, D’wayne Wiggins of Tony! Toni! Tone! or Toronto Raptors assistant coach Phil Handy — their pride is evident.

“What I’ve learned to love is it’s not a perfect city,” Cox said. “It’s not a passive city. It’s an aggressive city. It’s challenging and presents a lot of hurdles. It’s difficult to survive here, but it’s a beautiful struggle. We’re embracing of a super oxymoron of a city that’s the most beautiful, ugliest city in the world. But a broken mirror shows more pieces of you. That’s the image that explains Oakland to me: a broken mirror, revealing every tiny little thing.”

You can say the Warriors have given people reason to be even prouder, but it’s not just Oakland that will feel a void. If they’re not careful, the Warriors will lose some of their character, too.

“As a native Oaklander who’s lived my whole life in this city and often felt like our city is underappreciated and underestimated, this five-year run with the Warriors has been like a dream come true,” Oakland Mayor Libby Schaaf said. “I feel like the whole world has seen how beautiful, how diverse, how inclusive Oakland, Calif., is. This is a city with a spirit and a soul, and the Warriors have been a part of it.”

It’s that spirit and soul that the Warriors cannot lose. The money will be great, and if it can keep the roster intact, the team will remain great. But the Warriors don’t separate themselves merely with talent and resources. It’s their toughness that makes them special, a trait developed by sprouting up through the dirt of Oakland. Perhaps that’s why they insist on saying they are not leaving.