Can a candidate for an open seat in the state House be booted off the ballot based on the amount of electricity and water he uses in his home?

That is the question Commonwealth Court Judge Anne Covey is considering in a legal challenge to the candidacy of Frederick Ramirez, the Democratic candidate in the March 21 special election for the 197th District in North Philadelphia.

The challenge was filed by two registered Democrats and two registered Republicans in the district. But the Philadelphia Republican Party's fingerprints are all over the case.

Linda Kerns, the party's associate general counsel, filed the challenge and argued in court Wednesday. Annie Havey, the party's deputy director, assisted Kerns and testified that she investigated Ramirez's residency to help the Republican nominee in the case, Lucinda Little, who attended the six-hour hearing.

The 197th District seat is vacant because former State Rep. Leslie Acosta, a Democrat, resigned on Jan. 3 after pleading guilty to a felony embezzlement charge in federal court in March 2016.

Acosta sat in the back row of the courtroom during the hearing, subpoenaed by Kerns as a potential witness, but did not testify.

At the heart of the challenge are water and electricity bills for the home Ramirez bought in the district in 1988. Kerns said utility bills made clear "Mr. Ramirez is not really spending any time" at the house on the 400 block of West Annsbury Street.

Ramirez testified that he is at the house every day, though he stays in an Andorra apartment with his teenage daughter on weekends, occasionally sleeps at his girlfriend's house in Bristol, and travels often to Orlando for business and Puerto Rico to visit family.

Ramirez's attorney, Adam Bonin, submitted a stack of papers, including copies of Ramirez's driver's license, a permit to carry a concealed weapon, and tax and business forms from the city, state, and federal government, all listing the Annsbury address.

Candidates for the state House must reside in their district for at least one year before the election.

Kerns called two witnesses who live on Ramirez's block. One said she had seen him in the neighborhood but not at the house. The other said she had never seen him.

Covey allowed Kerns to submit affidavits from two more residents who said they believed Ramirez's house was vacant.

Bonin countered with two handymen who have worked on Ramirez's house, including one who gets his mail there. Both said they had seen him living there. A local Democratic committeeman who serves on the neighborhood Town Watch said he often saw Ramirez at or near the house.

Covey is expected to rule on the challenge next week.