code: def _validate_callable_param_count(cls, func: Callable, count: int) -> None:
          
          signature = inspect.signature(func)
          # validate that the callable has the right number of parameters
          nparam = len(signature.parameters)
          if nparam != count:
              raise TypeError('{} has {} positional arguments, expected {}'.format(
                  func.__name__,
                  nparam,
                  count,
              ))
docs: Ensure a function has the given number of parameters.