def split(self):
<EOL>self.sort_versions()<EOL>def _split(i_entry, n_variants, common_fams=None):<EOL><INDENT>result = self.entries[i_entry].split(n_variants)<EOL>if result:<EOL><INDENT>entry, next_entry = result<EOL>entries = self.entries[:i_entry] + [entry]<EOL>next_entries = [next_entry] + self.entries[i_entry + <NUM_LIT:1>:]<EOL><DEDENT>else:<EOL><INDENT>entries = self.entries[:i_entry + <NUM_LIT:1>]<EOL>next_entries = self.entries[i_entry + <NUM_LIT:1>:]<EOL><DEDENT>slice_ = self._copy(entries)<EOL>next_slice = self._copy(next_entries)<EOL>if self.pr:<EOL><INDENT>if common_fams:<EOL><INDENT>if len(common_fams) == <NUM_LIT:1>:<EOL><INDENT>reason_str = next(iter(common_fams))<EOL><DEDENT>else:<EOL><INDENT>reason_str = "<STR_LIT:U+002CU+0020>".join(common_fams)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>reason_str = "<STR_LIT>"<EOL><DEDENT>self.pr("<STR_LIT>",<EOL>reason_str, self, slice_, next_slice)<EOL><DEDENT>return slice_, next_slice<EOL><DEDENT>if len(self) > <NUM_LIT:2>:<EOL><INDENT>fams = self.first_variant.request_fams - self.extracted_fams<EOL><DEDENT>else:<EOL><INDENT>fams = None<EOL><DEDENT>if not fams:<EOL><INDENT>return _split(<NUM_LIT:0>, <NUM_LIT:1>)<EOL><DEDENT>prev = None<EOL>for i, entry in enumerate(self.entries):<EOL><INDENT>entry.sort()<EOL>for j, variant in enumerate(entry.variants):<EOL><INDENT>fams = fams & variant.request_fams<EOL>if not fams:<EOL><INDENT>return _split(*prev)<EOL><DEDENT>prev = (i, j + <NUM_LIT:1>, fams)<EOL><DEDENT><DEDENT>raise RezSystemError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (self, str(fams)))<EOL>
Split the slice.

        Returns:
            (`_PackageVariantSlice`, `_PackageVariantSlice`) tuple, where the
            first is the preferred slice.