def new_temp_filename(prefix=None, based_on=None, with_nonce=True):
  '''
  Return a new, temporary filename. If based_on is provided, return a path
  adjacent to the given path, but starting with prefix; otherwise return a name
  from the global temporary directory. If with_nonce is true, include a random
  string to ensure uniqueness. XXX: This is not secure and shouldn't be used for
  privileged execution.
  '''
  if based_on:
    if not prefix:
      prefix = ".tmp"
    # Note dirname(based_on) will be empty if based_on is a path with no path component.
    temp_path = (os.path.dirname(based_on) or ".", prefix, os.path.basename(based_on)) % "%s/%s.%s"
  else:
    temp_path = "%s/zinc-tmp" % TMP_DIR
    if prefix:
      temp_path = "%s.%s" % (temp_path, prefix)
  if with_nonce:
    temp_path = "%s.%s" % (temp_path, new_uid())
  return temp_path
dataset/ETHPy150Open bloomreach/zinc/zinc.py/new_temp_filename/swapped operands of `%`