code: def deepcopy(x, memo=None, _nil=[]):
      """Deep copy operation on arbitrary Python objects.
  
      See the module's __doc__ string for more info.
      """
  
      if memo is None:
          memo = {}
  
      d = id(x)
      y = memo.get(d, _nil)
      if y is not _nil:
          return y
  
      cls = type(x)
  
      copier = _deepcopy_dispatch.get(cls)
      if copier is not None:
          y = copier(x, memo)
      else:
          if issubclass(cls, type):
              y = _deepcopy_atomic(x, memo)
          else:
              copier = getattr(x, "__deepcopy__", None)
              if copier is not None:
                  y = copier(memo)
              else:
                  reductor = dispatch_table.get(cls)
                  if reductor:
                      rv = reductor(x)
                  else:
                      reductor = getattr(x, "__reduce_ex__", None)
                      if reductor is not None:
                          rv = reductor(4)
                      else:
                          reductor = getattr(x, "__reduce__", None)
                          if reductor:
                              rv = reductor()
                          else:
                              raise Error(
                                  "un(deep)copyable object of type %s"
                                  % cls
                              )
                  if isinstance(rv, str):
                      y = x
                  else:
                      y = _reconstruct(x, memo, *rv)
  
      # If is its own copy, don't memoize.
      if y is not x:
          memo[d] = y
          _keep_alive(
              x, memo
          )  # Make sure x lives at least as long as d
      return y
  
file_path: catboost/contrib/tools/python3/src/Lib/copy.py
imports: import types
  import weakref
  from copyreg import dispatch_table
label_desc: Use image node_id 3 for calling a global function with example usage: deepcopy(x, memo, _nil) and returns: y, y