code: def update_args_with_rootdir(args: List[str]) -> List[str]:
      """Adds `--rootdir` and path to the args `list` passed to `pytest.main`.
  
      This is required to ensure that pytest is able to find the SymPy tests in
      instances where it gets confused determining the root directory, e.g. when
      running with Pyodide (e.g. `bin/test_pyodide.mjs`).
  
      """
      args.extend(["--rootdir", str(sympy_dir())])
      return args
  
imports: import functools
  import importlib.util
  import os
  import pathlib
  import re
  from fnmatch import fnmatch
  from typing import List, Optional, Tuple
  from sympy.testing.runtests import test
label_desc: Use image node_id 2 for calling a global function with example usage: update_args_with_rootdir(args) and returns: args