def get_orientation(self, si, sj):
        """
        si, sj are two number series. To compute whether these two series have
        same orientation or not. We combine them in the two orientation
        configurations and compute length of the longest monotonic series.
        """
        if not si or not sj:
            return 0
        # Same orientation configuration
        a = lms(si + sj)
        b = lms(sj + si)
        # Opposite orientation configuration
        c = lms(si + sj[::-1])
        d = lms(sj[::-1] + si)
        return max(a, b)[0] - max(c, d)[0]
def get_orientation ( self , si , sj ) : if not si or not sj : return 0 a = lms ( si + sj ) b = lms ( sj + si ) c = lms ( si + sj [ : : - 1 ] ) d = lms ( sj [ : : - 1 ] + si ) return max ( a , b ) [ 0 ] - max ( c , d ) [ 0 ]
si, sj are two number series. To compute whether these two series have
        same orientation or not. We combine them in the two orientation
        configurations and compute length of the longest monotonic series.