<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def traverse(self):
 """Traverse proposal kernel"""


        if self.verbose > 1:
            print_('\t' + self._id + ' Running Traverse proposal kernel')

        # Mask for values to move
        phi = self.phi

        theta = self.traverse_theta

        # Calculate beta
        if (random() < (theta - 1) / (2 * theta)):
            beta = exp(1 / (theta + 1) * log(random()))
        else:
            beta = exp(1 / (1 - theta) * log(random()))

        if self._prime:
            xp, x = self.values
        else:
            x, xp = self.values

        if self.verbose > 1:
            print_('\t' + 'Current value = ' + str(x))

        x = (xp + beta * (xp - x)) * phi + x * (phi == False)

        if self.verbose > 1:
            print_('\t' + 'Proposed value = ' + str(x))

        self.stochastic.value = x

        # Set proposal adjustment factor
        self.hastings_factor = (sum(phi) - 2) * log(beta)