templater

codegen.templater

Functions

Name Description
format_code Format code using black for Python variants.

format_code

codegen.templater.format_code(code, format='python', use_black=True, **kwargs)

Format code using black for Python variants.

Parameters

Name Type Description Default
code str Source code string to format required
format str Language/variant (python, jax, numpy, scipy, tvboptim) 'python'
use_black bool Whether to apply black formatting (default True) True
**kwargs Any Additional black.FileMode options (line_length, etc.) {}