code: def generate_primes(limit=None):
      """Sieve of Eratosthenes"""
      not_prime = DefaultDict(list)
      num = 2
      while limit is None or num <= limit:
          if num in not_prime:
              for prime in not_prime[num]:
                  not_prime[prime + num].append(prime)
              del not_prime[num]
          else:
              yield num
              not_prime[num * num] = [num]
          num += 1
  
file_path: cortex/test/apis/realtime/prime-generator/app/main.py
imports: from typing import DefaultDict
  from fastapi import FastAPI
  from pydantic import BaseModel
label_desc: Use image node_id 1 for calling a global function with example usage: generate_primes(limit) without return types