def _partial_search_validator(self, sub, sup, anagram=False,<EOL>subsequence=False, supersequence=False):
def get_all_in(one, another):<EOL><INDENT>for element in one:<EOL><INDENT>if element in another:<EOL><INDENT>yield element<EOL><DEDENT><DEDENT><DEDENT>def containment_check(sub, sup):<EOL><INDENT>return (set(Counter(sub).keys()).issubset(<EOL>set(Counter(sup).keys())))<EOL><DEDENT>def containment_freq_check(sub, sup):<EOL><INDENT>return (all([Counter(sub)[element] <= Counter(sup)[element]<EOL>for element in Counter(sub)]))<EOL><DEDENT>def extra_freq_check(sub, sup, list_of_tups):<EOL><INDENT>return (len(list_of_tups) > <NUM_LIT:0> and<EOL>all([Counter(sub)[tup[<NUM_LIT:0>]] <= Counter(sup)[tup[<NUM_LIT:1>]]<EOL>for tup in list_of_tups]))<EOL><DEDENT>if len(sub) > len(sup):<EOL><INDENT>return False<EOL><DEDENT>for pred, func in set([(anagram, self._is_anagram_of),<EOL>(subsequence, self._is_subsequence_of),<EOL>(supersequence, self._is_supersequence_of)]):<EOL><INDENT>if pred:<EOL><INDENT>pred_seive = [(sub_key, sup_key)<EOL>for sub_key in set(Counter(sub).keys())<EOL>for sup_key in set(Counter(sup).keys())<EOL>if func(sub_key, sup_key)]<EOL>if not extra_freq_check(sub, sup, pred_seive):<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>if (<EOL>not any([anagram, subsequence, supersequence]) and<EOL>(not containment_check(sub, sup) or<EOL>not containment_freq_check(sub, sup))<EOL>):<EOL><INDENT>return False<EOL><DEDENT>for x1, x2 in zip(get_all_in(sup, sub), get_all_in(sub, sup)):<EOL><INDENT>if x1 != x2:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
It's responsible for validating the partial results of `search` method.
     If it returns True, the search would return its result. Else, search
     method would discard what it found and look for others.

     First, checks to see if all elements of `sub` is in `sup` with at least
     the same frequency and then checks to see if every element `sub`
     appears in `sup` with the same order (index-wise).
     If advanced control sturctures are specified, the containment condition
     won't be checked.
     The code for index checking is from [1]_.

     Parameters
     ----------
     sub : list
     sup : list
     anagram : bool, optional
         Default is `False`
     subsequence : bool, optional
         Default is `False`
     supersequence : bool, optional
         Default is `False`

     Returns
     -------
     bool

     References
     ----------
     .. [1] : `
https://stackoverflow.com/questions/35964155/checking-if-list-is-a-sublist`