def _validate_nrows(nrows):
 msg = "'nrows' must be an integer"
 if (nrows is not None):
  if is_float(nrows):
   if (int(nrows) != nrows):
    raise ValueError(msg)
   nrows = int(nrows)
  elif (not is_integer(nrows)):
   raise ValueError(msg)
 return nrows

def _validate_nrows ( nrows ) : msg = "'nrows' must be an integer" if ( nrows is not None ) : if is_float ( nrows ) : if ( int ( nrows ) != nrows ) : raise ValueError ( msg ) nrows = int ( nrows ) elif ( not is_integer ( nrows ) ) : raise ValueError ( msg ) return nrows
checks whether the nrows parameter for parsing is either an integer or float that can safely be cast to an integer without losing accuracy .