This is the belief from Japan that if someone plays flute midnight, it will bring snakes to house, therefore no one should play it during night time.
People in Japan do not really believe in this folk belief now but in the past, thieves used to whistle to gather other thieves to escape from police. Whistle was used as a sign to signal others, so this belief was actually true in the past. In order to bring thieves close to people’s house they should not play flute. Now playing a flute just causes troubles with neighbors so the belief is used as a different context.