def ResetTempfileModule(_time=time.time):
  # pylint: disable=W0212
  if ((sys.hexversion >= 0x020703F0 and sys.hexversion < 0x03000000) or
      sys.hexversion >= 0x030203F0):
    # Python 2.7 automatically resets the RNG on pid changes (i.e. forking)
    return

  try:
    lock = tempfile._once_lock
    lock.acquire()
    try:
      # Re-seed random name generator
      if tempfile._name_sequence:
        tempfile._name_sequence.rng.seed(hash(_time()) ^ os.getpid())
    finally:
      lock.release()
  except AttributeError:
    logging.critical("The tempfile module misses at least one of the"
                     " '_once_lock' and '_name_sequence' attributes")
Name of a new leaf replacement for this expression
dataset/ETHPy150Open ganeti/ganeti/lib/utils/wrapper.py/ResetTempfileModule--crossover with--dataset/ETHPy150Open blaze/blaze/blaze/compute/core.py/makeleaf