def _build_more_args(func_settings: tp.Kwargs, func_kwargs: tp.Kwargs) -> tp.Args: pass_kwargs = func_settings.get('pass_kwargs', []) more_args = () for key in pass_kwargs: value = None if isinstance(key, tuple): key, value = key else: if key.startswith('temp_idx_arr'): value = np.empty((input_shape[0],), dtype=np.int_) value = func_kwargs.get(key, value) more_args += (value,) return more_args
def _get_func_names(func_settings: tp.Kwargs, setting: str, all_names: tp.Sequence[str]) -> tp.List[str]: func_input_names = func_settings.get(setting, None) if func_input_names is None: return [] else: for name in func_input_names: checks.assert_in(name, all_names) return func_input_names