def copy(src_parent, src_idx, dest_parent, dest_idx):
  """Copy an item."""
  if isinstance(dest_parent, list):
    dest_idx = int(dest_idx)
  dest_parent[dest_idx] = get_child(src_parent, src_idx)
Copy an item.