Add get_by_key function to extract value by key from HashMaps