"got %s" % (rank,))
elif isinstance(rank, bool):
raise TypeError(err_msg)
elif rank is not None and notisinstance(rank, dict):
try:
rank = int(operator.index(rank))
except TypeError:
After Change
def _check_rank(rank):
Check rank parameter.
_validate_type(rank, (None, dict, str), "rank")
if isinstance(rank, str):
if rank not in ["full", "info"]:
raise ValueError("rank, if str, must be "full" or "info", "
"got %s" % (rank,))