Sharing insert will fail if you'll attempt to insert a row with same "meaning" (ParentId, UserOrGroupId, RowCause) more than once.
The most hassle-free way to deal with it is to use `Database.insert(myRows, false);` ;)
The more proper way would be to build a `Map<String, AccountShare>` where string is a composite key of these 3 values and when you're ready - `insert myMap.values();`. But it's a waste of script statements if the platform already does this check for you... plus what if you'll clash with existing old record, you'd be safest using `Database` version again.