code: def unlocked_repo(f):
      @wraps(f)
      def wrapper(exp, *args, **kwargs):
          exp.repo.lock.unlock()
          exp.repo._reset()
          try:
              ret = f(exp, *args, **kwargs)
          finally:
              exp.repo.lock.lock()
          return ret
  
      return wrapper
  
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 2 for calling a global function with example usage: unlocked_repo(f) and returns: wrapper, ret