code: def pop(self, index=-1) -> Union[int, Expression]:
          
  
          try:
              return super(MachineStack, self).pop(index)
          except IndexError:
              raise StackUnderflowException("Trying to pop from an empty stack")
docs: :param index:index to be popped, same as the list() class.
          :returns popped value
          :function: same as list() class but throws StackUnderflowException for popping from an empty list