code: def _run_format_and_flake8():
      files_changed = False
  
      try:
          check_bash_call("python -m black --check ./")
      except CalledProcessError:
          check_bash_call("python -m black ./")
          files_changed = True
  
      try:
          check_bash_call("buildifier -mode=check -r .")
      except CalledProcessError:
          check_bash_call("buildifier -r .")
          files_changed = True
  
      # todo: find a way to check if files changed
      # see https://github.com/DoozyX/clang-format-lint-action for inspiration
      check_bash_call(
          "shopt -s globstar && clang-format-9 -i --style=google **/*.cc **/*.h",
      )
  
      if files_changed:
          print("Some files have changed.")
          print("Please do git add and git commit again")
      else:
          print("No formatting needed.")
  
      print("Running flake8.")
      check_bash_call("flake8")
      print("Done")
  
      if files_changed:
          exit(1)
  
imports: from subprocess import check_call, CalledProcessError
label_desc: Use image node_id 2 for calling a global function with example usage: _run_format_and_flake8() without return types