code: def _syscmd_file(target, default=""):
      """Interface to the system's file command.
  
      The function uses the -b option of the file command to have it
      omit the filename in its output. Follow the symlinks. It returns
      default in case the command should fail.
  
      """
      if sys.platform in ("dos", "win32", "win16"):
          # XXX Others too ?
          return default
  
      try:
          import subprocess
      except ImportError:
          return default
      target = _follow_symlinks(target)
      # "file" output is locale dependent: force the usage of the C locale
      # to get deterministic behavior.
      env = dict(os.environ, LC_ALL="C")
      try:
          # -b: do not prepend filenames to output lines (brief mode)
          output = subprocess.check_output(
              ["file", "-b", target], stderr=subprocess.DEVNULL, env=env
          )
      except (OSError, subprocess.CalledProcessError):
          return default
      if not output:
          return default
      # With the C locale, the output should be mostly ASCII-compatible.
      # Decode from Latin-1 to prevent Unicode decode error.
      return output.decode("latin-1")
  
imports: import collections
  import os
  import re
  import sys
  import functools
  import itertools
label_desc: Use image node_id 16 for calling a global function with example usage: _syscmd_file(target, default) and returns: output, default, default, default, default