@classmethod
  def _check(cls, name, val, can_be_zero=False, val_type=float):
    valid_types = [val_type]
    if val_type is float:
      valid_types.append(int)

    if type(val) not in valid_types:
      raise TypeError(
          'Expect type %s for parameter %s' % (val_type.__name__, name))
    if val < 0:
      raise ValueError(
          'Value for parameter %s has to be greater than 0' % name)
    if not can_be_zero and val == 0:
      raise ValueError(
          'Value for parameter %s can not be 0' % name)
    return val
Check init arguments.
dataset/ETHPy150Open GoogleDeveloperExperts/experts-app-backend/cloudstorage/api_utils.py/RetryParams._check