def check(grad_honests, f_real, **kwargs):
  """ Check parameter validity for this attack.
  Args:
    grad_honests Non-empty list of honest gradients
    f_real       Number of Byzantine gradients to generate
    ...          Ignored keyword-arguments
  Returns:
    Whether the given parameters are valid for this attack
  """
  if not isinstance(grad_honests, list) or len(grad_honests) == 0:
    return "Expected a non-empty list of honest gradients, got %r" % (grad_honests,)
  if not isinstance(f_real, int) or f_real < 0:
    return "Expected a non-negative number of Byzantine gradients to generate, got %r" % (f_real,)