You could also switch Debugging right up to developer and reproduce the error again. That will give you a trace of it being called.
My bet is that you have a plugin that calls get_current_group. This is also in deprecatedlib.php but does not throw a warning. BUT... it does call mygroupid() which (as you found out) does.
So, either find what called get_current_group() or do the trace.
I have a feeling that I submitted a bug about this...
EDIT:
I submitted one very similar, not this. However, I have now - MDL-50818