def METHOD_NAME(self):
    param = self.block.getParamInfo("type")
    if param and param.value:
        self.setBlockType(param.value)
    elif self.block.types:
        self.setBlockType(sorted(self.block.types.keys())[0])