title: Map an array into another array
body: <p>I have an array of dict like:</p>
  
  <pre><code>[{'id': 1, 'tags': ['tag_a', 'tag_b']}, {'id': 2, 'tags': ['tag_c', 'tag_b']}]
  </code></pre>
  
  <p>and I would like to convert this array into a new array based on <code>ticket_id</code> and each <code>tag</code> value should be an object in the array. </p>
  
  <p>I almost did it using the following function:</p>
  
  <pre><code>raw = [{'id': 1, 'tags': ['tag_a', 'tag_b']}, {'id': 2, 'tags': ['tag_c', 'tag_b']}]
  
  def transform(ticket):
      result = []
      for tag in ticket.get('tags', []):
          result.append({'ticket_id': ticket.get('id'), 'tag': tag, 'sync': '123'})
      return result
  
  print(list(map(transform, raw)))
  </code></pre>
  
  <p>But it's returning something like <code>[[{...}], [{...}]]</code> and the syntax looks strange.</p>
  
  <p>What is the right approach to return something like:</p>
  
  <pre><code>[{'ticket_id': 1, 'tag': 'tag_a', 'sync': '123'}, {'ticket_id': 1, 'tag': 'tag_b', 'sync': '123'}, ...]
  </code></pre>