Check if a value is np.NaT.
350477
def isnat(obj):
    
    if obj.dtype.kind not in ('m', 'M'):
        raise ValueError("%s is not a numpy datetime or timedelta")
    return obj.view(int64_dtype) == iNaT
1093727
def is_none(node):
    ""
    return isinstance(node, parso.python.tree.Keyword) and node.value == 'None'
590195
def is_scalar(value: Any) -> bool:
    
    return (
        getattr(value, 'ndim', None) == 0 or
        isinstance(value, (str, bytes)) or not
        isinstance(value, (Iterable, ) + dask_array_type))
1311585
def is_set(name):
  """"""
  val = os.environ.get(name, '0')
  assert val == '0' or val == '1', f"env var {name} has value {val}, expected 0 or 1"
  return val == '1'
1181823
def is_number(obj):
    """"""
    return isinstance(obj, (int, float, np.int_, np.float_))
1183116
def _validate_python_version(s):
    ""
    if not s:
        return True
    toks = s.split('.')
    if len(toks) != 2:
        return False
    try:
        int(toks[0])
        int(toks[1])
    except ValueError:
        return False
    return True
760346
def to_boolean(value):
    
    if value is not None:
        if str(value).lower() in TRUE_TOKENS:
            return True

        vfloat = to_number(float, value)
        if vfloat is not None:
            return bool(vfloat)

    return False
583857
def check_is_an_array(var, allow_none=False):
    
    if not is_an_array(var, allow_none=allow_none):
        raise TypeError("var must be a NumPy array, however type(var) is {}"
                        .format(type(var)))
192082
def _isnan(self):
        
        if self._can_hold_na:
            return isna(self)
        else:
            # shouldn't reach to this condition by checking hasnans beforehand
            values = np.empty(len(self), dtype=np.bool_)
            values.fill(False)
            return values
675438
def is_int_type(val):
    """"""
    try:               # Python 2
        return isinstance(val, (int, long))
    except NameError:  # Python 3
        return isinstance(val, int)
232402
def boolean(value):
    '''
    
    '''
    if value is None or isinstance(value, bool):
        return value

    try:
        return bool(int(value))
    except ValueError:
        lower_value = value.strip().lower()
        if not lower_value:
            return None
        if lower_value in ('f', 'false', 'n', 'no', 'off'):
            return False
        if lower_value in ('on', 't', 'true', 'y', 'yes'):
            return True
        raise Invalid('Unable to parse boolean {0}'.format(value))
613308
def check_nsp(dist, attr, value):
    """"""
    ns_packages = value
    assert_string_list(dist, attr, ns_packages)
    for nsp in ns_packages:
        if not dist.has_contents_for(nsp):
            raise DistutilsSetupError(
                "Distribution contains no modules or packages for " +
                "namespace package %r" % nsp
            )
        parent, sep, child = nsp.rpartition('.')
        if parent and parent not in ns_packages:
            distutils.log.warn(
                "WARNING: %r is declared as a package namespace, but %r"
                " is not: please correct this in setup.py", nsp, parent
            )
51237
def safe(self,x):
        """"""
        x[np.isinf(x)] = 1
        x[np.isnan(x)] = 1
        return x
1061587
private static boolean isUnaryComparison(@Nullable Object value) {
    return value == null || value.equals(Double.NaN) || value.equals(Float.NaN);
  }
1005526
def is_valid_shape(value):
    """"""
    if is_int_positive(value):
        return True, value
    elif isinstance(value, tuple) or isinstance(value, list):
        for v in value:
            if not is_int_positive(v):
                return False, value
        return True, value
    else:
        return False, value
567080
def is_unit(value):
    """"""
    if not _has_astropy:
        raise ImportError("astropy must be installed for unit support")
    if (isinstance(value, units.Unit) or isinstance(value, units.IrreducibleUnit) or isinstance(value, units.CompositeUnit)):
        return True, value
    else:
        return False, value
54280
def _check_tbit(self, **keys):
        
        colnums = keys.get('colnums', None)

        if colnums is None:
            colnums = self._extract_colnums()

        has_tbit = False
        for i, colnum in enumerate(colnums):
            npy_type, isvar, istbit = self._get_tbl_numpy_dtype(colnum)
            if (istbit):
                has_tbit = True
                break

        return has_tbit