:type name str
    :type value_type Type
    :type item_help str
    :type default Type
    :rtype ModuleArgumentsBuilder
19393
def add_default_argument(self, name, value_type, item_help, default=None):
    
    if value_type not in self.__restricted_default_types:
      raise ArgumentException("Positional(default) argument couldn't have {} type".format(value_type.__name__))

    if self.__is_default_arg_flag_used and default is None:
      raise ArgumentException("After defining first default Positional argument, rest should have default value too".format(value_type.__name__))
    elif default is not None:
      self.__is_default_arg_flag_used = True

      if not isinstance(default, value_type):
        raise ArgumentException("Invalid default type for argument".format(name))

    self._default_args.append(ModuleArgumentItem(name, value_type, item_help, default=default))
    return self
883906
def build_type(self, build_type):
        
        allowed_values = ["MVN", "NPM"]
        if build_type not in allowed_values:
            raise ValueError(
                "Invalid value for `build_type` ({0}), must be one of {1}"
                .format(build_type, allowed_values)
            )

        self._build_type = build_type
774468
def _resolve_args(self, env, args):
        
        pos_args, kw_args = args

        def check_value(v):
            if isinstance(v, AstTypeRef):
                return self._resolve_type(env, v)
            else:
                return v

        new_pos_args = [check_value(pos_arg) for pos_arg in pos_args]
        new_kw_args = {k: check_value(v) for k, v in kw_args.items()}
        return new_pos_args, new_kw_args
975872
def resolve_type_name(ctx, param, value):  # pylint: disable=unused-argument
    """"""

    def _resolve(value):
        """Resolve single type name"""
        value = [
            type_id
            for type_id, type_name in W1ThermSensor.TYPE_NAMES.items()
            if type_name == value
        ][0]
        return value

    if not value:
        return value

    if isinstance(value, tuple):
        return [_resolve(v) for v in value]
    else:
        return _resolve(value)
736768
def _get_type(stype):
    ''' 
    '''
    stype = stype.lower()
    if stype == 'str':
        return str
    if stype == 'unicode':
        if PY2:
            return unicode
        else:
            return str
    if stype == 'int':
        return int
    if stype == 'float':
        return float
    if stype == 'bool':
        return bool
    raise AppConfigValueException('Unsuported type given: {0}'.format(stype))
1293095
def types(self, *args):
        
        return ', '.join(['{0}({1})'.format(type(arg).__name__, arg) for arg in args])
311238
def p_param_types(self, p):
        ''''''
        if len(p) == 2:
            p[0] = tuple((t,) for t in p[1])
        elif len(p) == 3:
            p[0] = tuple((t,) for t in p[1]) + ((),)
        elif len(p) == 4:
            p[0] = tuple((t,) + ts for t in p[1] for ts in p[3])
        else:
            non_defaults = [t for t in p[4] if len(t) == len(p[4][0])]
            p[0] = tuple((t,) + ts for t in p[1] for ts in non_defaults) + p[4]
751838
def base_type(self, value):
        
        if value == self._defaults['baseType'] and 'baseType' in self._values:
            del self._values['baseType']
        else:
            self._values['baseType'] = value
1141729
def struct_types(self):
        
        it = ffi.lib.LLVMPY_ModuleTypesIter(self)
        return _TypesIterator(it, dict(module=self))
784292
def get_item_type(self, ttype):
        
        for i in self.map_item:
            if TYPE_MAP_ITEM[i.get_type()] == ttype:
                return i.get_item()
        return None
1372219
def friendly_type_name(raw_type: typing.Type) -> str:
    
    try:
        return _TRANSLATE_TYPE[raw_type]
    except KeyError:
        LOGGER.error('unmanaged value type: %s', raw_type)
        return str(raw_type)
700245
def constraint_from_choices(cls, value_type: type, choices: collections.Sequence):
        
        choices_str = ', '.join(map(str, choices))

        def constraint(value):
            value = value_type(value)
            if value not in choices:
                raise ParameterError('Argument must be one of %s' % choices_str)
            return value

        constraint.__name__ = 'choices_%s' % value_type.__name__
        constraint.__doc__ = 'choice of %s' % choices_str
        return constraint
852321
def default_value(self, argname):
        
        i = _find_arg(argname, self.args)[0]
        if i is not None:
            idx = i - (len(self.args) - len(self.defaults))
            if idx >= 0:
                return self.defaults[idx]
        i = _find_arg(argname, self.kwonlyargs)[0]
        if i is not None and self.kw_defaults[i] is not None:
            return self.kw_defaults[i]
        raise exceptions.NoDefault(func=self.parent, name=argname)
949040
def bind_type(python_value):
    """"""
    binding_table = {'bool': Bool, 'int': Int, 'float': Float}

    if python_value is None:
        return NoneType()

    python_type = type(python_value)

    gibica_type = binding_table.get(python_type.__name__)

    if gibica_type is None:
        raise TypeError('Impossible to recognize underlying type.')
    return gibica_type(python_value)
969633
def backing_type_for(value):
        
        if isinstance(value, str):
            vtype = "S"
        elif isinstance(value, bytes):
            vtype = "B"
        # NOTE: numbers.Number check must come **AFTER** bool check since isinstance(True, numbers.Number)
        elif isinstance(value, bool):
            vtype = "BOOL"
        elif isinstance(value, numbers.Number):
            vtype = "N"
        elif isinstance(value, dict):
            vtype = "M"
        elif isinstance(value, list):
            vtype = "L"
        elif isinstance(value, set):
            if not value:
                vtype = "SS"  # doesn't matter, Set(x) should dump an empty set the same for all x
            else:
                inner = next(iter(value))
                if isinstance(inner, str):
                    vtype = "SS"
                elif isinstance(inner, bytes):
                    vtype = "BS"
                elif isinstance(inner, numbers.Number):
                    vtype = "NS"
                else:
                    raise ValueError(f"Unknown set type for inner value {inner!r}")
        else:
            raise ValueError(f"Can't dump unexpected type {type(value)!r} for value {value!r}")
        return vtype
65260
def AssertType(value, expected_type):
  
  if not isinstance(value, expected_type):
    message = "Expected type `%r`, but got value `%r` of type `%s`"
    message %= (expected_type, value, type(value))
    raise TypeError(message)
1037840
def get_type(name, library):
        
        if name == None:
            raise Exception("Class name cannot be null")
        if library == None:
            raise Exception("Module name cannot be null")

        try:
            module = importlib.import_module(library)
            return getattr(module, name)
        except:
           return None