import os import re from pathlib import Path def search_in_file(file_path): try: with open(file_path, 'r', encoding='utf-8') as f: content = f.read() s3_matches = re.finditer(r'["\']s3_[^"\']*["\']', content) dataset_matches = re.finditer(r'dataset-cached|dataset_cached', content) results = [] for match in s3_matches: results.append(f"S3 config: {match.group()}") for match in dataset_matches: results.append(f"Dataset cached: {match.group()}") if results: print(f"\nIn {file_path}:") for result in results: print(f" {result}") except Exception as e: print(f"Error reading file {file_path}: {e}") def search_files(): root_dir = Path(__file__).parent.parent for path in root_dir.rglob('*.py'): if 'venv' not in str(path) and '.git' not in str(path): search_in_file(path) if __name__ == '__main__': search_files()