<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def map(cls, sources, *, transform_args=None):
 """Generates instances from the sources using either cls.transform_args or transform_args argument if present. """

    for idx, source in enumerate(sources):
      try:
        yield cls.create(source, transform_args=transform_args)
      except Exception as ex:
        raise Exception("An error occurred with item {0}".format(idx)) from ex