Merge Sort Python - Error message : I tried to write a Merge Sort function, but when I try to run the program I received an error :'the name mergesort is not defined'.Thank you very much!

        def merge(self,a,b):

        sorted_list=[]

        while len(a)!=0 and len(b)!=0:

            if a[0].get_type()<b[0].get_type():
                sorted_list.append(a[0])
                a.remove(a[0])
            else:
                sorted_list.append(b[0])
                b.remove(b[0])
        if len(a)==0:
            sorted_list+=b
        else:
            sorted_list+=a

        return sorted_list


    def mergesort(self,lis):

        if len(lis) == 0 or len(lis) == 1:
            return lis
        else:
            middle = len(lis)// 2
            a = mergesort(lis[middle:]) #in pycharm the next 3 lines are with red underlined
            b = mergesort(lis[middle:])
            return merge(a,b)