Ungroup Dupes

Hello,

I know that I can "Ungroup" Dupes through the context menu, but I would like to use a button to perform that function. Can someone here please tell me what that function is in script form?

Thank you in advance.

Set GROUPBY=off

Thank you.