<s>[INST] ### Task: Write a function `flatten_dict` which takes an arbitrary nested dictionary as input and returns a new dictionary with all keys "flattened". The keys in the new dictionary are the original keys of the old dictionary but with nested keys joined by a '.' (dot) symbol.[/INST]