def to_serializable(self):
task_metadata = self.task_metadata<EOL>task_params = self.task_params<EOL>task_resources = self.task_resources<EOL>task_id = None<EOL>if task_metadata.get('<STR_LIT>') is not None:<EOL><INDENT>task_id = str(task_metadata.get('<STR_LIT>'))<EOL><DEDENT>task = {'<STR_LIT>': task_id}<EOL>task['<STR_LIT>'] = task_metadata.get('<STR_LIT>')<EOL>task['<STR_LIT>'] = task_metadata.get('<STR_LIT>')<EOL>if task_resources.logging_path:<EOL><INDENT>task['<STR_LIT>'] = str(task_resources.logging_path.uri)<EOL><DEDENT>task['<STR_LIT>'] = {var.name: var.value for var in task_params['<STR_LIT>']}<EOL>task['<STR_LIT>'] = {var.name: var.value for var in task_params['<STR_LIT>']}<EOL>task['<STR_LIT>'] = {<EOL>var.name: var.value<EOL>for var in task_params['<STR_LIT>']<EOL>if not var.recursive<EOL>}<EOL>task['<STR_LIT>'] = {<EOL>var.name: var.value<EOL>for var in task_params['<STR_LIT>']<EOL>if var.recursive<EOL>}<EOL>task['<STR_LIT>'] = {<EOL>var.name: var.value<EOL>for var in task_params['<STR_LIT>']<EOL>if not var.recursive<EOL>}<EOL>task['<STR_LIT>'] = {<EOL>var.name: var.value<EOL>for var in task_params['<STR_LIT>']<EOL>if var.recursive<EOL>}<EOL>return _remove_empty_items(task, ['<STR_LIT>'])<EOL>
Return a dict populated for serialization (as YAML/JSON).