code: def write(self, proto):
      
      regionImpl = proto.regionImpl.as_struct(self.getSchema())
      self.writeToProto(regionImpl)
docs: Calls :meth:`~nupic.bindings.regions.PyRegion.PyRegion.writeToProto`
      on subclass after converting proto to specific type using
      :meth:`~nupic.bindings.regions.PyRegion.PyRegion.getSchema`.
  
      :param proto: PyRegionProto capnproto object