[python] Python:Efficient way to check if dictionary is empty or not