code: def _platform(*args):
      """Helper to format the platform string in a filename
      compatible format e.g. "system-version-machine".
      """
      # Format the platform string
      platform = "-".join(x.strip() for x in filter(len, args))
  
      # Cleanup some possible filename obstacles...
      platform = platform.replace(" ", "_")
      platform = platform.replace("/", "-")
      platform = platform.replace("\\", "-")
      platform = platform.replace(":", "-")
      platform = platform.replace(";", "-")
      platform = platform.replace('"', "-")
      platform = platform.replace("(", "-")
      platform = platform.replace(")", "-")
  
      # No need to report 'unknown' information...
      platform = platform.replace("unknown", "")
  
      # Fold '--'s and remove trailing '-'
      while 1:
          cleaned = platform.replace("--", "-")
          if cleaned == platform:
              break
          platform = cleaned
      while platform[-1] == "-":
          platform = platform[:-1]
  
      return platform
  
imports: import collections
  import os
  import re
  import sys
  import functools
  import itertools
label_desc: Use image node_id 13 for calling a global function with example usage: _platform() and returns: platform