code: def map_collection(func, collection):
      
      datatype = type(collection)
      if isinstance(collection, Mapping):
          return datatype((key, func(val)) for key, val in collection.items())
      if is_string(collection):
          return collection
      elif isinstance(collection, Iterable):
          return datatype(map(func, collection))
      else:
          return collection
docs: Apply func to each element of a collection, or value of a dictionary.
      If the value is not a collection, return it unmodified