(template_type: str, template: Template, *, exist_ok: bool = False, **kwargs)
| 139 | |
| 140 | |
| 141 | def register_template(template_type: str, template: Template, *, exist_ok: bool = False, **kwargs) -> None: |
| 142 | if not exist_ok and template_type in TEMPLATE_MAPPING: |
| 143 | raise ValueError(f'The `{template_type}` has already been registered in the TEMPLATE_MAPPING.') |
| 144 | template.template_type = template_type |
| 145 | template_info = {'template': template, **kwargs} |
| 146 | TEMPLATE_MAPPING[template_type] = template_info |
| 147 | |
| 148 | |
| 149 | register_template( |
no outgoing calls
no test coverage detected
searching dependent graphs…