code: def system_supports_plotting():
      
      try:
          if os.environ['ALLOW_PLOTTING'].lower() == 'true':
              return True
      except KeyError:
          pass
      try:
          p = Popen(["xset", "-q"], stdout=PIPE, stderr=PIPE)
          p.communicate()
          return p.returncode == 0
      except:
          return False
docs: Check if x server is running
  
      Returns
      -------
      system_supports_plotting : bool
          True when on Linux and running an xserver.  Returns None when
          on a non-linux platform.