python get method nested dictionary