<garvit244>4_1.py
def findMedianSortedArrays( nums1, nums2):
    if len(nums1) > len(nums2):
        nums1, nums2 = nums2, nums1
    
    x, y = len(nums1), len(nums2)
    low , high = 0, x
    
    while  low <= high:
        partitionx = (low+high)/2
        partitiony = (x+y+1)/2 - partitionx
        if partitionx == 0:
            maxLeftX = float('-inf')
        else:
            maxLeftX = nums1[partitionx-1]
    
        if partitionx == x:
            minRightX = float('inf')
        else:
            minRightX = nums1[partitionx]
    
        if partitiony == 0:
            maxLeftY = float('-inf')
        else:
            maxLeftY = nums2[partitiony-1]
    
        if partitiony == y:
            minRightY = float('inf')
        else:
            minRightY = nums2[partitiony]
    
        if maxLeftX <= minRightY and maxLeftY <= minRightX:
            if((x+y)%2 == 0):
                return (max(maxLeftX, maxLeftY) + min(minRightX, minRightY))/2.0
            else:
                return max(maxLeftY, maxLeftX)
        elif maxLeftX > minRightY:
            high = partitionx - 1
        else:
            low = partitionx + 1
def sample_funcname ( var_0 , var_1 ) :
    if len ( var_0 ) > len ( var_1 ) :
        var_0 , var_1 = var_1 , var_0
    var_3 , var_4 = len ( var_0 ) , len ( var_1 )
    var_6 , var_7 = 0 , var_3
    while var_6 <= var_7 :
        var_9 = ( var_6 + var_7 ) / 2
        var_11 = ( var_3 + var_4 + 1 ) / 2 - var_9
        if var_9 == 0 :
            var_14 = float ( '-inf' )
        else :
            var_14 = var_0 [ var_9 - 1 ]
        if var_9 == var_3 :
            var_16 = float ( 'inf' )
        else :
            var_16 = var_0 [ var_9 ]
        if var_11 == 0 :
            var_17 = float ( '-inf' )
        else :
            var_17 = var_1 [ var_11 - 1 ]
        if var_11 == var_4 :
            var_18 = float ( 'inf' )
        else :
            var_18 = var_1 [ var_11 ]
        if var_14 <= var_18 and var_17 <= var_16 :
            if ( ( var_3 + var_4 ) % 2 == 0 ) :
                return ( max ( var_14 , var_17 ) + min ( var_16 , var_18 ) ) / 2.0
            else :
                return max ( var_17 , var_14 )
        elif var_14 > var_18 :
            var_7 = var_9 - 1
        else :
            var_6 = var_9 + 1
