code: def _flake():
      """Test flake8"""
      orig_dir = os.getcwd()
      import_dir, dev = _get_import_dir()
      os.chdir(op.join(import_dir, ".."))
      if dev:
          sys.argv[1:] = ["vispy", "examples", "make"]
      else:
          sys.argv[1:] = [op.basename(import_dir)]
      try:
          try:
              from flake8.main import main
          except ImportError:
              from flake8.main.cli import main
      except ImportError:
          print("Skipping flake8 test, flake8 not installed")
      else:
          print(
              "Running flake8... "
          )  # if end='', first error gets ugly
          sys.stdout.flush()
          try:
              main()
          except SystemExit as ex:
              if ex.code in (None, 0):
                  pass  # do not exit yet, we want to print a success msg
              else:
                  raise RuntimeError("flake8 failed")
      finally:
          os.chdir(orig_dir)
  
imports: from __future__ import print_function
  import sys
  import os
  import warnings
  from os import path
  from copy import deepcopy
  from functools import partial
  from ..util import use_log_level, run_subprocess
  from ..util.ptime import time
  from ._testing import has_application, nottest, IS_CI, IS_TRAVIS_CI
label_desc: Use image node_id 4 for calling a global function with example usage: _flake() without return types