code: def test_repository_lightningignore_supports_different_patterns(
      tmp_path,
  ):
      """.lightningignore parsing supports different patterns."""
      # write .lightningignore file
      # default github python .gitignore
      lightningignore = """
      # ignore files in this dir
      ignore/
  
      # Byte-compiled / optimized / DLL files
      __pycache__/
      *.py[cod]
      *$py.class
  
      # C extensions
      *.so
  
      # Distribution / packaging
      .Python
      build/
      develop-eggs/
      dist/
      downloads/
      eggs/
      .eggs/
      lib/
      lib64/
      parts/
      sdist/
      var/
      wheels/
      *.egg-info/
      .installed.cfg
      *.egg
      MANIFEST
  
      # PyInstaller
      #  Usually these files are written by a python script from a template
      #  before PyInstaller builds the exe, so as to inject date/other infos into it.
      *.manifest
      *.spec
  
      # Installer logs
      pip-log.txt
      pip-delete-this-directory.txt
  
      # Unit test / coverage reports
      htmlcov/
      .tox/
      .coverage
      .coverage.*
      .cache
      nosetests.xml
      coverage.xml
      *.cover
      .hypothesis/
      .pytest_cache/
  
      # Translations
      *.mo
      *.pot
  
      # Django stuff:
      *.log
      local_settings.py
      db.sqlite3
  
      # Flask stuff:
      instance/
      .webassets-cache
  
      # Scrapy stuff:
      .scrapy
  
      # Sphinx documentation
      docs/_build/
  
      # PyBuilder
      target/
  
      # Jupyter Notebook
      .ipynb_checkpoints
  
      # pyenv
      .python-version
  
      # celery beat schedule file
      celerybeat-schedule
  
      # SageMath parsed files
      *.sage.py
  
      # Environments
      .env
      .env.docker
      .venv
      env/
      venv/
      ENV/
      env.bak/
      venv.bak/
  
      # Spyder project settings
      .spyderproject
      .spyproject
  
      # Rope project settings
      .ropeproject
  
      # mkdocs documentation
      /site
  
      # mypy
      .mypy_cache/
  
      # VS Code files
      .vscode/
  
      # UI files
      node_modules/
  
      # Data files
      models/
      models/*
      !grid/openapi/models
      postgresql_data/
      redis_data/
  
      # Secrets folders
      secrets/
  
      # Built UI
      ui/
  
      # Ignores Grid Runner
      vendor/
      ignore_test.py
  
      # Ignore cov report
      *.xml
  
      """
      (tmp_path / ".lightningignore").write_text(lightningignore)
      (tmp_path / "test.txt").write_text("test")
  
      repository = LocalSourceCodeDir(path=Path(tmp_path))
  
      assert set(repository.files) == {
          str(tmp_path / ".lightningignore"),
          str(tmp_path / "test.txt"),
      }
  
      # write file that needs to be ignored
      (tmp_path / "ignore").mkdir()
      (tmp_path / "ignore/test.txt").write_text(str(uuid.uuid4()))
  
      # check that version remains the same
      repository = LocalSourceCodeDir(path=Path(tmp_path))
  
      assert set(repository.files) == {
          str(tmp_path / ".lightningignore"),
          str(tmp_path / "test.txt"),
      }
  
file_path: pytorch-lightning/tests/tests_app/source_code/test_local.py
imports: import os
  import sys
  import tarfile
  import uuid
  from pathlib import Path
  from unittest import mock
  import pytest
  from lightning.app.source_code import LocalSourceCodeDir
label_desc: Use image node_id 7 for calling a global function with example usage: test_repository_lightningignore_supports_different_patterns(tmp_path) without return types