code: def __clean_tmp(sfn):
      '''
      Clean out a template temp file
      '''
      if sfn.startswith(os.path.join(tempfile.gettempdir(),
                                     salt.utils.files.TEMPFILE_PREFIX)):
          # Don't remove if it exists in file_roots (any saltenv)
          all_roots = itertools.chain.from_iterable(
                  six.itervalues(__opts__['file_roots']))
          in_roots = any(sfn.startswith(root) for root in all_roots)
          # Only clean up files that exist
          if os.path.exists(sfn) and not in_roots:
              os.remove(sfnf __clean_tmp(sfn):
      '''
      Clean out a template temp file
      '''
      if sfn.startswith(os.path.join(tempfile.gettempdir(),
                                     salt.utils.files.TEMPFILE_PREFIX)):
          # Don't remove if it exists in file_roots (any saltenv)
          all_roots = itertools.chain.from_iterable(
                  six.itervalues(__opts__['file_roots']))
          in_roots = any(sfn.startswith(root) for root in all_roots)
          # Only clean up files that exist
          if os.path.exists(sfn) and not in_roots:
              os.remove(sfn)
docs: Clean out a template temp file