<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def target_types_by_alias(self):
 """Returns a mapping from target alias to the target types produced for that alias. Normally there is 1 target type per alias, but macros can expand a single alias to several target types. :API: public :rtype: dict """

    target_types_by_alias = defaultdict(set)
    for alias, target_type in self.target_types.items():
      target_types_by_alias[alias].add(target_type)
    for alias, target_macro_factory in self.target_macro_factories.items():
      target_types_by_alias[alias].update(target_macro_factory.target_types)
    return dict(target_types_by_alias)