code: def system_in_tmpdir(tmpdir):
      """Return a function that will execute system commands in the desired directory"""
  
      def system_(*args):
          return system(*args, cwd=str(tmpdir))
  
      return system_
  
file_path: jupytext/tests/external/pre_commit/test_pre_commit_scripts.py
imports: import os
  import stat
  import unittest.mock
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook
  from jupytext import read, write
  from jupytext.cli import jupytext, system
  from jupytext.compare import compare_cells, compare_notebooks
label_desc: Use image node_id 2 for calling a global function with example usage: system_in_tmpdir(tmpdir) and returns: system_, system