<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _kmp_search_first(self, pInput_sequence, pPattern):
 """use KMP algorithm to search the first occurrence in the input_sequence of the pattern. both arguments are integer arrays. return the position of the occurence if found; otherwise, -1."""

                input_sequence, pattern = pInput_sequence, [len(bin(e)) for e in pPattern]
                n, m = len(input_sequence), len(pattern)
                d = p = 0
                next = self._kmp_construct_next(pattern)
                while d < n and p < m:
                        p = next[len(bin(input_sequence[d]))][p]
                        d += 1
                if p == m: return d - p
                else: return -1