Some of this seems to be debug code which has been left in, some of it seems to just be old code that was commented out and never put back in and probably just forgotten about. Either way, we use git for a reason, so there's no need for these code snippets to stick around. The code history can be inspected and old code retrieved that way.