Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _prep_macro(self, func):
if func not in self._prepped_macros:
kwargs = {i.name for i in signature(func).parameters.values() if i.kind is Parameter.KEYWORD_ONLY}
special_params = {
'directives': self.directives,
'n_states': self.n_states,
'variables': self.vars,
'table': self
}.items()
self._prepped_macros[func] = partial(typecast(func), **{k: v for k, v in special_params if k in kwargs})
return self._prepped_macros[func]