checks whether v is of type list,dict or Config
518114
def is_config_container(v):
    

    cls = type(v)

    return (
        issubclass(cls, list) or
        issubclass(cls, dict) or
        issubclass(cls, Config)
    )
421494
def _des_dict_check(self, des_dict, req_keys, cond_name):
        """"""
        assert isinstance(des_dict, dict), '{}' \
            ' must be a dictionary. Got {}.'.format(cond_name, type(des_dict))
        if bool(des_dict) is True:
            input_keys = list(des_dict.keys())
            for key in req_keys:
                assert key in input_keys, 'Required key "{}" was not found in ' \
                    '{}'.format(key, cond_name)
1206367
def _verify_config_dict(self, valid, config, dev_os, key_path=None):
        '''
        
        '''
        if not key_path:
            key_path = []
        for key, value in valid.items():
            self._verify_config_key(key, value, valid, config, dev_os, key_path)
34020
def _is_reference(arg):
    '''
    
    '''
    return isinstance(arg, dict) and len(arg) == 1 and isinstance(next(six.itervalues(arg)), six.string_types)
335982
def oftype(self, typ):
        ''''''
        for key, val in self.items():
            if val.type == typ:
                yield key
1260729
def _check_for_default_values(fname, arg_val_dict, compat_args):
    
    for key in arg_val_dict:
        # try checking equality directly with '=' operator,
        # as comparison may have been overridden for the left
        # hand object
        try:
            v1 = arg_val_dict[key]
            v2 = compat_args[key]

            # check for None-ness otherwise we could end up
            # comparing a numpy array vs None
            if (v1 is not None and v2 is None) or \
               (v1 is None and v2 is not None):
                match = False
            else:
                match = (v1 == v2)

            if not is_bool(match):
                raise ValueError("'match' is not a boolean")

        # could not compare them directly, so try comparison
        # using the 'is' operator
        except ValueError:
            match = (arg_val_dict[key] is compat_args[key])

        if not match:
            raise ValueError(("the '{arg}' parameter is not "
                              "supported in the pandas "
                              "implementation of {fname}()".
                              format(fname=fname, arg=key)))
391286
def check_headers(func):
    
    @wraps(func)
    def wrapper(*args, **kwargs):
        if request.method in ('POST', 'PATCH'):
            if 'Content-Type' in request.headers and\
                    'application/vnd.api+json' in request.headers['Content-Type'] and\
                    request.headers['Content-Type'] != 'application/vnd.api+json':
                error = json.dumps(jsonapi_errors([{'source': '',
                                                    'detail': "Content-Type header must be application/vnd.api+json",
                                                    'title': 'Invalid request header',
                                                    'status': '415'}]), cls=JSONEncoder)
                return make_response(error, 415, {'Content-Type': 'application/vnd.api+json'})
        if 'Accept' in request.headers:
            flag = False
            for accept in request.headers['Accept'].split(','):
                if accept.strip() == 'application/vnd.api+json':
                    flag = False
                    break
                if 'application/vnd.api+json' in accept and accept.strip() != 'application/vnd.api+json':
                    flag = True
            if flag is True:
                error = json.dumps(jsonapi_errors([{'source': '',
                                                    'detail': ('Accept header must be application/vnd.api+json without'
                                                               'media type parameters'),
                                                    'title': 'Invalid request header',
                                                    'status': '406'}]), cls=JSONEncoder)
                return make_response(error, 406, {'Content-Type': 'application/vnd.api+json'})
        return func(*args, **kwargs)
    return wrapper
699397
def isconst(cls, val):
        ''' 

        '''
        return isinstance(val, string_types) and \
               ((len(val) == 7 and val[0] == "#") or val in enums.NamedColor)
893690
def iswhat(o):
    
    import inspect
    isfs = {n: f for n, f in inspect.getmembers(inspect) if n[0:2] == "is"}
    return {n: f(o) for n, f in isfs.items()}
656694
def is_dicteq(dict1_, dict2_, almosteq_ok=True, verbose_err=True):
    
    import utool as ut
    assert len(dict1_) == len(dict2_), 'dicts are not of same length'
    try:
        for (key1, val1), (key2, val2) in zip(dict1_.items(), dict2_.items()):
            assert key1 == key2, 'key mismatch'
            assert type(val1) == type(val2), 'vals are not same type'
            if HAVE_NUMPY and np.iterable(val1):
                if almosteq_ok and ut.is_float(val1):
                    assert np.all(ut.almost_eq(val1, val2)), 'float vals are not within thresh'
                else:
                    assert all([np.all(x1 == x2) for (x1, x2) in zip(val1, val2)]), 'np vals are different'
            elif isinstance(val1, dict):
                is_dicteq(val1, val2, almosteq_ok=almosteq_ok, verbose_err=verbose_err)
            else:
                assert val1 == val2, 'vals are different'
    except AssertionError as ex:
        if verbose_err:
            ut.printex(ex)
        return False
    return True
1008758
function isTypedArray( v ) {
	var i;
	v = typeName( v );
	for ( i = 0; i < NAMES.length; i++ ) {
		if ( NAMES[ i ] === v ) {
			return true;
		}
	}
	return false;
}
885269
def is_tuple(type_: Type[Any]) -> bool:
    '''
    
    '''
    if HAS_TUPLEARGS:
        # The tuple, Tuple thing is a difference between 3.6 and 3.7
        # In 3.6 and before, Tuple had an __extra__ field, while Tuple[something]
        # would have the normal __origin__ field.
        #
        # Those apply for Dict, List, Set, Tuple
        return _generic_type_check(type_, tuple, Tuple)
    else:
        # Old python
        return _issubclass(type_, Tuple) and _issubclass(type_, tuple) == False
1279641
def _infer_dict(obj):
    '''
    '''
    for ats in (('__len__', 'get', 'has_key',     'items',     'keys',     'values'),
                ('__len__', 'get', 'has_key', 'iteritems', 'iterkeys', 'itervalues')):
        for a in ats:  # no all(<generator_expression>) in Python 2.2
            if not _callable(getattr(obj, a, None)):
                break
        else:  # all True
            return True
    return False
382146
def is_of_types(obj, the_types):
    '''
    
    '''
    if not isinstance(obj, the_types):
        raise KittyException('object type (%s) is not one of (%s)' % (type(obj), the_types))
655703
def _filter_types(types_dict):
    # type: (Dict[FunctionKey, T]) -> Dict[FunctionKey, T]
    """"""

    def exclude(k):
        # type: (FunctionKey) -> bool
        """Exclude filter"""
        return k.path.startswith('<') or k.func_name == '<module>'

    return {k: v for k, v in iteritems(types_dict) if not exclude(k)}
896397
def is_variable(tup):
    
    name, item = tup
    if callable(item):
        # function or class
        return False

    if isinstance(item, types.ModuleType):
        # imported module
        return False

    if name.startswith("_"):
        # private property
        return False

    return True
1297001
def _expect_vars(vs=None):
        """"""
        if vs is None:
            return list()
        elif isinstance(vs, Variable):
            return [vs]
        else:
            checked = list()
            # Will raise TypeError if vs is not iterable
            for v in vs:
                if isinstance(v, Variable):
                    checked.append(v)
                else:
                    fstr = "expected Variable, got {0.__name__}"
                    raise TypeError(fstr.format(type(v)))
            return checked