human
Complete the below
def _cmp_by_med(path1, path2):

    ''''Select the path based with lowest MED value.
    If both paths have same MED, return None.
    By default, a route that arrives with no MED value is treated as if it
    had a MED of 0, the most preferred value.
    RFC says lower MED is preferred over higher MED value.'
    '''
 ... Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    def get_path_med(path):
        med = path.get_pattr(BGP_ATTR_TYPE_MULTI_EXIT_DISC)
        if (not med):
            return 0
        return med.value
    med1 = get_path_med(path1)
    med2 = get_path_med(path2)
    if (med1 == med2):
        return None
    elif (med1 < med2):
        return path1
    return path2