(self, s)
return min(i, len(self.completions)-1)
Find the first index in self.completions where completions[i] is
        greater or equal to s, or the last index if there is no such.
Find the first index in self.completions where completions[i] is
        greater or equal to s, or the last index if there is no such.
Find the first index in self . completions where completions [ i ] is greater or equal to s or the last index if there is no such .
def _binary_search(self, s):
        """Find the first index in self.completions where completions[i] is
        greater or equal to s, or the last index if there is no such.
        """
        i = 0; j = len(self.completions)
        while j > i:
            m = (i + j) // 2
            if self.completions[m] >= s:
                j = m
            else:
                i = m + 1
        return min(i, len(self.completions)-1)
def _binary_search ( self , s ) : i = 0 j = len ( self . completions ) while j > i : m = ( i + j ) // 2 if self . completions [ m ] >= s : j = m else : i = m + 1 return min ( i , len ( self . completions ) - 1 )