Where can you find a master ball?

You get a master ball either from your cheats if you have any or else you get a master ball from the boss of team galactic (cyrus when you beat him in head quarters).(This answer is for Pokemon Diamond and Pearl).