code: def random_leaf(self):
          "Returns a random variable with the associated weight"
          for i in range(self._number_tries_feasible_ind):
              var = np.random.randint(self.nvar)
              v = self._random_leaf(var)
              if v is None:
                  continue
              return v
          raise RuntimeError("Could not find a suitable random leaf"f random_leaf(self):
          "Returns a random variable with the associated weight"
          for i in range(self._number_tries_feasible_ind):
              var = np.random.randint(self.nvar)
              v = self._random_leaf(var)
              if v is None:
                  continue
              return v
          raise RuntimeError("Could not find a suitable random leaf")
docs: Returns a random variable with the associated weight