<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_schema(self):
 """Return process schema for this process."""

        process_type = self.metadata.process_type
        if not process_type.endswith(':'):
            process_type = '{}:'.format(process_type)

        schema = {
            'slug': self.metadata.slug,
            'name': self.metadata.name,
            'type': process_type,
            'version': self.metadata.version,
            'data_name': '',
            'requirements': {
                'executor': {
                    'docker': {
                        'image': 'resolwe/base:ubuntu-18.04',
                    },
                },
            },
        }

        if self.metadata.description is not None:
            schema['description'] = self.metadata.description
        if self.metadata.category is not None:
            schema['category'] = self.metadata.category
        if self.metadata.scheduling_class is not None:
            schema['scheduling_class'] = self.metadata.scheduling_class
        if self.metadata.persistence is not None:
            schema['persistence'] = self.metadata.persistence
        if self.metadata.requirements is not None:
            schema['requirements'] = self.metadata.requirements
        if self.metadata.data_name is not None:
            schema['data_name'] = self.metadata.data_name
        if self.metadata.entity is not None:
            schema['entity'] = self.metadata.entity

        if self.inputs:
            schema['input'] = []
            for field in self.inputs.values():
                schema['input'].append(field.to_schema())

        if self.outputs:
            schema['output'] = []
            for field in self.outputs.values():
                schema['output'].append(field.to_schema())

        schema['run'] = {
            'language': 'python',
            'program': self.source or '',
        }

        return schema