Why does engine cut off after idling for awhile?

Mine does the same but I know it's the mechanical choke along with a bad float.