code: def _factor_generator(n):
      
      p = prime_factors(n)
      factors = {}
      for p1 in p:
          try:
              factors[p1] += 1
          except KeyError:
              factors[p1] = 1
      return factors
docs: From a given natural integer, returns the prime factors and their multiplicity
      :param n: Natural integer
      :return: