class_docstr: Map operator.
  
  Project each element of an input sequence into a new form.
  two cases:
     1. The operator return normal element.
  
         ---1---2---3---4--->
     [   map('input', 'output', lambda i: i + 1)    ]
         ---2---4---6---8--->
  
     2. The operator return a generator.
  
     def func(i):
          num = 0
          while num < i:
              yield num
              num += 1
  
         ---1---2---3---4--->
     [   map('input', 'output', func)    ]
         ---[0]---[0, 1]---[0, 1, 2]---[0, 1, 2, 3]--->
code: def _get_from_generator(self, gen, size):
      if size == 1:
          return list(gen)
      ret = [[] for _ in range(size)]
      for data in gen:
          for i in range(size):
              ret[i].append(data[i])
      return ret
  
file_path: towhee/towhee/runtime/nodes/_map.py
imports: from typing import Generator
  from towhee.runtime.data_queue import Empty
  from towhee.runtime.time_profiler import Event
  from .node import Node
  from ._single_input import SingleInputMixin
label_desc: Use image node_id 2 for calling the Map obj's underlying member method code with example usage: obj._get_from_generator(gen, size) and returns: ret, list