code: def find_extension(source_file, sourcecache: SourceCache):
      for ext in EXTENSIONS:
          if source_file.get_filename().endswith(f"wrapper{ext}"):
              return source_file
  
      for ext in EXTENSIONS:
          script = source_file.join(f"wrapper{ext}")
  
          if sourcecache.exists(script):
              return script
  
file_path: snakemake/snakemake/wrapper.py
imports: from snakemake.exceptions import WorkflowError
  from snakemake.script import script
  from snakemake.sourcecache import SourceCache, infer_source_file
label_desc: Use image node_id 4 for calling a global function with example usage: find_extension(source_file, sourcecache) and returns: source_file, script