def METHOD_NAME(self, pageNo):
    if pageNo in self.set:
        # Page Hit condition -> the page number is already present in the cache
        print(f'{pageNo} -> Page Hit')
        curr = self.head.next
        start = curr
        while curr != self.tail:
            if curr.pageNo == pageNo:
                # Remove the page from the cache from its initial position and add it to
                # the staring of the list
                start = curr
                curr.prev.next = curr.next
                curr.next.prev = curr.prev
                nextCurr = curr.next
                curr.next = None
                curr.prev = None
                curr = nextCurr
            else:
                curr = curr.next
        start.next = self.head.next
        start.prev = self.head
        self.head.next = start
        start.next.prev = start
    else:
        # Page Miss condition -> the page number is not present in the cache
        print(f'{pageNo} -> Page Miss')
        self.set.add(pageNo)
        # Add the new page number to the head of the List
        pg = Node(pageNo)
        pg.next = self.head.next
        pg.prev = self.head
        self.head.next = pg
        pg.next.prev = pg
        if self.pages == self.frameSize:
            # If there is no frames left for the new frame then remove the least recently
            # used page(last page from the list)
            rem = self.tail.prev
            rem.prev.next = self.tail
            self.tail.prev = rem.prev
            rem.next = None
            rem.prev = None
            self.set.remove(rem.pageNo)
        else:
            # If there are frames left then increase the number of pages in the cache
            self.pages += 1