<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_region_controller(self):
 """Convert to a `RegionController` object. `node_type` must be `NodeType.REGION_CONTROLLER` or `NodeType.REGION_AND_RACK_CONTROLLER`. """

        if self.node_type not in [
                NodeType.REGION_CONTROLLER,
                NodeType.REGION_AND_RACK_CONTROLLER]:
            raise ValueError(
                'Cannot convert to `RegionController`, node_type is not a '
                'region controller.')
        return self._origin.RegionController(self._data)