<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)