code: def git_project_select_rules(project_dir):
      git_ignored = _git_ls_ignored(
          project_dir, extended_patterns_file=".guildignore"
      )
      ignored_dirs = _dirs_for_git_ignored(git_ignored, project_dir)
      return [
          # Ignore directories first as an optimization
          FileSelectRule(False, [".git"] + ignored_dirs, "dir"),
          # Git ignore select selects everything that isn't ignored -
          # this must be placed before rules that exclude patterns
          _GitignoreSelectRule(git_ignored),
          FileSelectRule(False, [".git*", ".guildignore"]),
      ]
  
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 17 for calling a global function with example usage: git_project_select_rules(project_dir) and returns: list