code: def get_exp_rwlock(
      repo: "Repo",
      reads: Optional[List[str]] = None,
      writes: Optional[List[str]] = None,
  ):
      reads = reads or []
      writes = writes or []
  
      cmd = " ".join(sys.argv)
      assert repo.tmp_dir is not None
      path = os.path.join(repo.tmp_dir, EXEC_TMP_DIR)
      repo.fs.makedirs(path, exist_ok=True)
  
      return rwlock(
          path,
          repo.fs,
          cmd,
          reads,
          writes,
          repo.config["core"].get("hardlink_lock", False),
      )
  
imports: import os
  import random
  import sys
  from collections import defaultdict
  from functools import wraps
  from typing import TYPE_CHECKING, Callable, Dict, Generator, Iterable, List, Mapping, Optional, Set, Tuple, Union
  from dvc.exceptions import InvalidArgumentError
  from dvc.repo.experiments.exceptions import AmbiguousExpRefInfo
  from dvc.rwlock import rwlock
  from dvc.scm import Git
  from .refs import EXEC_APPLY, EXEC_BASELINE, EXEC_BRANCH, EXPS_NAMESPACE, ITER_SKIP_NAMESPACES, STASHES, ExpRefInfo
label_desc: Use image node_id 1 for calling a global function with example usage: get_exp_rwlock(repo, reads, writes) and returns: rwlock