code: def _git_ls_ignored(cwd, extended_patterns_file=None):
      try:
          gitver = git_version()
      except GitNotInstalled:
          _maybe_warn_git_not_installed(cwd)
          raise NoVCS(cwd) from None
      else:
          if gitver < GIT_LS_FILES_TARGET_VER:
              return _git_ls_ignored_legacy(cwd, extended_patterns_file)
          return _git_ls_ignored_(cwd, extended_patterns_file)
  
imports: import collections
  import logging
  import re
  import os
  import subprocess
  from guild import config
  from guild import file_util
  from guild import util
  from guild.file_util import FileSelectRule
label_desc: Use image node_id 18 for calling a global function with example usage: _git_ls_ignored(cwd, extended_patterns_file) and returns: _git_ls_ignored_, _git_ls_ignored_legacy