code: def factor(n):
      """Yield the prime factors of n.
      >>> list(factor(360))
      [2, 2, 2, 3, 3, 5]
      """
      for prime in sieve(math.isqrt(n) + 1):
          while True:
              if n % prime:
                  break
              yield prime
              n //= prime
              if n == 1:
                  return
      if n > 1:
          yield n
  
imports: import math
  import operator
  from collections import deque
  from collections.abc import Sized
  from functools import partial, reduce
  from itertools import chain, combinations, compress, count, cycle, groupby, islice, product, repeat, starmap, tee, zip_longest
  from random import randrange, sample, choice
label_desc: Use image node_id 41 for calling a global function with example usage: factor(n) without return types