I'm taking the undergraduate capstone design course in electrical engineering at a university in the U.S. and I've been receiving some programming help from a friend who is not, nor ever has been, a student at the school. I understand that a certain amount of professional assistance is acceptable, however, there was a significant programming snag that I encountered that I would not have been able to solve on my own without this person's help. I have not asked my professor directly about this yet (there's still time, though!) since I've been afraid of self-incriminating and that I may be asked to remove the code which would put me back to my major snag that I can't solve. At this late point in the course, this solution is essential as removing it would likely force our group to alter direction/scope. This is a design project and not a programming project (I'm currently using plenty of acceptable open-source code from GitHub) and I feel my group has legitimately created original design work. Obviously, I have no problems at all citing any sources I used for the project as my goal is to avoid cheating.
My question is this:
Can I use code that was created specifically for my capstone design project by a knowledgeable person (with my assistance) without cheating if I cite the source? Would it make it more acceptable if this person posted this same code to GitHub as well since other GitHub resources have already been deemed acceptable?