code: def mode(self, mode):
          
          allowed_values = ["test", "live"]
          if mode is not None and mode not in allowed_values:
              raise ValueError(
                  "Invalid value for `mode` ({0}), must be one of {1}"
                  .format(mode, allowed_values)
              )
  
          self._mode = mode
docs: Sets the mode of this BraintreeGateway.
  
  
          :param mode: The mode of this BraintreeGateway.
          :type: str