code: def _where_to_scope(func):
      @wraps(func)
      def wrapper(*args, **kwargs):
          if "where" in kwargs:
              if "scope" in kwargs:
                  raise ValueError(
                      "Do not specify both 'scope' and DEPRECATED 'where'"
                  )
              kwargs = kwargs.copy()
              where = kwargs.pop("where")
              if where == "dataset":
                  warnings.warn(
                      "'where=\"dataset\"' is deprecated, use 'scope=\"branch\"' instead",
                      DeprecationWarning,
                  )
                  where = "branch"
              else:
                  warnings.warn(
                      "'where' is deprecated, use 'scope' instead",
                      DeprecationWarning,
                  )
              kwargs["scope"] = where
          return func(*args, **kwargs)
  
      return wrapper
  
imports: import json
  import logging
  import os
  import re
  import threading
  import warnings
  from collections import namedtuple
  from fasteners import InterProcessLock
  from functools import lru_cache, wraps
  from pathlib import Path
  import datalad
  from datalad.consts import DATASET_CONFIG_FILE
  from datalad.runner import CommandError, GitRunner, KillOutput, StdOutErrCapture
  from datalad.utils import getpwd, on_windows
label_desc: Use image node_id 3 for calling a global function with example usage: _where_to_scope(func) and returns: wrapper, func