code: def _dup_scopes(orig_scopes, scopes, paths):
      """Duplicated scopes."""
      mapping = dict(zip(orig_scopes, scopes))
      scopes = []
      for root, path in paths:
          scope = mapping[root]
          for name in path:
              scope = scope.push(name, reuse=True)
          scopes.append(scope)
      return scopes
  
imports: import collections
  import dataclasses
  import functools
  from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Sequence, Tuple, TypeVar, Union
  import warnings
  from flax import traceback_util
  import jax
  from jax import random
  from .None import axes_scan, meta
  from .frozen_dict import freeze, unfreeze
  from .scope import CollectionFilter, DenyList, Filter, PRNGSequenceFilter, Scope, group_collections, in_filter, intersect_filters, is_filter_empty, subtract_filters, union_filters
label_desc: Use image node_id 3 for calling a global function with example usage: _dup_scopes(orig_scopes, scopes, paths) and returns: scopes