(v)
when ordering a list of (possibly complex) values, prefer:
      binary-op < memory < global < local-var < i32
when ordering a list of (possibly complex) values, prefer:
      binary-op < memory < global < local-var < i32
when ordering a list of ( possibly complex ) values prefer : binary - op < memory < global < local - var < i32
def get_type_sort_order(v):
    '''
    when ordering a list of (possibly complex) values, prefer:
      binary-op < memory < global < local-var < i32
    '''
    if isinstance(v, BinaryOperation):
        return 1
    elif isinstance(v, Memory):
        return 2
    elif isinstance(v, GlobalVariable):
        return 3
    elif isinstance(v, LocalVariable):
        return 4
    elif isinstance(v, I32):
        return 5
    else:
        raise ValueError('unexpected value type')
def get_type_sort_order ( v ) : if isinstance ( v , BinaryOperation ) : return 1 elif isinstance ( v , Memory ) : return 2 elif isinstance ( v , GlobalVariable ) : return 3 elif isinstance ( v , LocalVariable ) : return 4 elif isinstance ( v , I32 ) : return 5 else : raise ValueError ( 'unexpected value type' )