def Dup(x, **unused_kwargs):
  """Duplicate (copy) the first element on the stack."""
  if isinstance(x, list):
    return [x[0]] + x
  if isinstance(x, tuple):
    return tuple([x[0]] + list(x))
  return [x, x]