Return single, existing super type typedef or None.
519342
def _derive_typedef(typ):
    '''
    '''
    v = [v for v in _values(_typedefs) if _issubclass(typ, v.type)]
    if len(v) == 1:
        return v[0]
    return None
286858
def p_NonAnyType_object(p):
  """"""
  p[0] = helper.unwrapTypeSuffix(model.SimpleType(
    type=model.SimpleType.OBJECT), p[2])
1152241
def get_kind(self, value):
        """"""
        if isinstance(value, float):
            return 'f'
        elif isinstance(value, int):
            return 'i'
        else:
            raise ValueError("Only integer or floating point values can be stored.")
122297
def default(self) -> Optional[ScalarValue]:
        """"""
        if self.mandatory:
            return None
        if self._default is not None:
            return self._default
        return (None if self.type.default is None
                else ArrayValue([self.type.default]))
1026053
def get_default(self, ctx):
        """"""
        # Otherwise go with the regular default.
        if callable(self.default):
            rv = self.default()
        else:
            rv = self.default
        return self.type_cast_value(ctx, rv)
810429
def _none():
    """"""

    Mock = type("Mock", (), {"__getattr__": lambda Qt, attr: None})

    Qt.__binding__ = "None"
    Qt.__qt_version__ = "0.0.0"
    Qt.__binding_version__ = "0.0.0"
    Qt.QtCompat.loadUi = lambda uifile, baseinstance=None: None
    Qt.QtCompat.setSectionResizeMode = lambda *args, **kwargs: None

    for submodule in _common_members.keys():
        setattr(Qt, submodule, Mock())
        setattr(Qt, "_" + submodule, Mock())
404901
def s(cls: Type[C], *args, **kwargs) -> Partial[C]:
        
        return Partial(cls, *args, **kwargs)
401986
def remove_alias(type_):
    
    if isinstance(type_, cpptypes.type_t):
        type_ref = type_
    elif isinstance(type_, typedef.typedef_t):
        type_ref = type_.decl_type
    else:
        # Not a valid input, just return it
        return type_
    if type_ref.cache.remove_alias:
        return type_ref.cache.remove_alias
    no_alias = __remove_alias(type_ref.clone())
    type_ref.cache.remove_alias = no_alias
    return no_alias
93783
def get_qualified_type(stmt):
    
    type_obj = stmt.search_one('type')
    fq_type_name = None
    if type_obj:
        if getattr(type_obj, 'i_typedef', None):
            # If type_obj has typedef, substitute.
            # Absolute module:type instead of prefix:type
            type_obj = type_obj.i_typedef
        type_name = type_obj.arg
        if check_primitive_type(type_obj):
            # Doesn't make sense to qualify a primitive..I think.
            fq_type_name = type_name
        else:
            type_module = type_obj.i_orig_module.arg
            fq_type_name = '%s:%s' % (type_module, type_name)
    return fq_type_name
636131
def type(self):
        
        # pylint: disable=no-member
        if self.args.args and self.args.args[0].name == "self":
            if isinstance(self.parent.scope(), ClassDef):
                return "method"
        return "function"
444371
def key_type(self, type_):
        """"""
        if not self.is_mapping(type_):
            raise TypeError(
                'Type "%s" is not "mapping" container' %
                str(type_))
        return self.__find_xxx_type(
            type_,
            self.key_type_index,
            self.key_type_typedef,
            'container_key_type')
997952
def one(self):
        """"""
        # See zero() for remarks
        def one_vec(x, out=None, **kwargs):
            """One function, vectorized."""
            if is_valid_input_meshgrid(x, self.domain.ndim):
                scalar_out_shape = out_shape_from_meshgrid(x)
            elif is_valid_input_array(x, self.domain.ndim):
                scalar_out_shape = out_shape_from_array(x)
            else:
                raise TypeError('invalid input type')

            out_shape = self.out_shape + scalar_out_shape

            if out is None:
                return np.ones(out_shape, dtype=self.scalar_out_dtype)
            else:
                fill_value = np.ones(1, dtype=self.scalar_out_dtype)[0]
                out.fill(fill_value)

        return self.element_type(self, one_vec)
203128
def base_type(self, type):
        """"""
        while 1:
            if type.arg == "leafref":
                node = type.i_type_spec.i_target_node
            elif type.i_typedef is None:
                break
            else:
                node = type.i_typedef
            type = node.search_one("type")
        if type.arg == "decimal64":
            return [type.arg, int(type.search_one("fraction-digits").arg)]
        elif type.arg == "union":
            return [type.arg, [self.base_type(x) for x in type.i_type_spec.types]]
        else:
            return type.arg
1354796
def _gettype(self):
        '''
        
        
        '''
        current = self
        lastname = getattr(current._parser, 'typedef', None)
        while hasattr(current, '_sub'):
            current = current._sub
            tn = getattr(current._parser, 'typedef', None)
            if tn is not None:
                lastname = tn
        return lastname
813545
def typedefs(
            self,
            name=None,
            function=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):
        """"""
        return (
            self._find_multiple(
                self._impl_matchers[scopedef_t.typedef],
                name=name,
                function=function,
                decl_type=self._impl_decl_types[
                    scopedef_t.typedef],
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )
567270
def _clean(self, value):
        """"""
        if value is None:
            return None
        elif self.type_ is None:
            return value
        elif self.check_type(value):
            return value
        elif self.is_type_castable:  # noqa
            return self.type_(value)

        error_fmt = "%s must be a %s, not a %s"
        error = error_fmt % (self.name, self.type_, type(value))
        raise TypeError(error)
1244670
def type(self):
        """"""
        if self.xc in self.defined_aliases: return self.defined_aliases[self.xc].type
        xc = (self.x, self.c)
        if xc in self.defined_aliases: return self.defined_aliases[xc].type

        # If self is not in defined_aliases, use LibxcFunc family
        if self.xc is not None: return self.xc.family
        return "+".join([self.x.family, self.c.family])