Finds and links the TypeSpec with the given name.
510380
def resolve_type_spec(self, name, lineno):
        """"""

        if name in self.type_specs:
            return self.type_specs[name].link(self)

        if '.' in name:
            include_name, component = name.split('.', 1)
            if include_name in self.included_scopes:
                return self.included_scopes[include_name].resolve_type_spec(
                    component, lineno
                )

        raise ThriftCompilerError(
            'Unknown type "%s" referenced at line %d%s' % (
                name, lineno, self.__in_path()
            )
        )
1201220
def type_name(value):
    """"""
    return type(value).__name__ if isinstance(value, EncapsulatedNode) else \
           "struct" if isinstance(value, dict) else \
           "sequence" if isinstance(value, (tuple, list)) else \
           type(value).__name__
1211186
def getTypeStr(_type):
  
  """
  if isinstance(_type, CustomType):
    return str(_type)

  if hasattr(_type, '__name__'):
    return _type.__name__

  return ''
1264175
def _compute_type_url(klass, prefix=_GOOGLE_APIS_PREFIX):
    
    name = klass.DESCRIPTOR.full_name
    return "%s/%s" % (prefix, name)
26258
def formatted_param_type(ptype):
    """"""
    pt_name = ptype["name"]
    if pt_name.startswith("<byname>"):
        pt_name = pt_name.replace("<byname>[", "=> ")[:-1]
    elif pt_name.startswith("<repeated>"):
        pt_name = pt_name.replace("<repeated>[", "")[:-1] + "*"
    return pt_name
715481
def _FormatTypeCheck(type_):
  """"""
  if isinstance(type_, tuple):
    items = [_FormatTypeCheck(t) for t in type_]
    return "(%s)" % ", ".join(items)
  elif hasattr(type_, "__name__"):
    return type_.__name__
  else:
    return repr(type_)
318807
def _resolve_name(self, name):
        
        res = [name]
        while True:
            orig_names = self._search("types", name)
            if orig_names is not None:
                name = orig_names[-1]
                # pop off the typedefd name
                res.pop()
                # add back on the original names
                res += orig_names
            else:
                break

        return res
1327369
function lookupQualifiedType(qname) {
	var t = type_env.get(qname)
	if (!t)
		throw new TypeError("Unresolved type: " + qname)
	return t;
}
1311130
def search(cls, name, lookup=None):
        

        for spath in lookup:
            spath = os.path.abspath(spath) + os.sep
            fname = os.path.abspath(os.path.join(spath, name))
            if not fname.startswith(spath): continue
            if os.path.isfile(fname): return fname
            for ext in cls.extensions:
                if os.path.isfile('%s.%s' % (fname, ext)):
                    return '%s.%s' % (fname, ext)
386433
def parse_type_reference(lexer: Lexer) -> TypeNode:
    """"""
    start = lexer.token
    if expect_optional_token(lexer, TokenKind.BRACKET_L):
        type_ = parse_type_reference(lexer)
        expect_token(lexer, TokenKind.BRACKET_R)
        type_ = ListTypeNode(type=type_, loc=loc(lexer, start))
    else:
        type_ = parse_named_type(lexer)
    if expect_optional_token(lexer, TokenKind.BANG):
        return NonNullTypeNode(type=type_, loc=loc(lexer, start))
    return type_
1107491
function (name_type) {
		let name = '';
		if (typeof name_type === 'undefined' || name_type === '' || name_type === 'random') {
			// randomize a type...
			name_type = randomizer.rollRandom(Object.keys(namedata.options));
		}
		if (typeof namedata[name_type]['surname'] === 'undefined' || r_helpers.isEmpty(namedata[name_type]['surname'])) {
			return '';
		}
		switch (name_type) {
			case 'holmesian':
				name = holmesname();
				break;
			case 'cornish':
			case 'flemish':
			case 'dutch':
			case 'turkish':
			default:
				name = randomizer.rollRandom(namedata[name_type]['surname']);
				name = randomizer.findToken(name);
				break;
		}
		return capitalizeName(name);
	}
1305372
def get_type(type_name):
    
    parts = type_name.split('.')
    if len(parts) < 2:
        raise SphinxError(
            'Type must be fully-qualified, '
            'of the form ``module.MyClass``. Got: {}'.format(type_name)
        )
    module_name = ".".join(parts[0:-1])
    name = parts[-1]
    return getattr(import_module(module_name), name)
1345887
def _match_type(self, i):
        """"""
        self.col_match = self.RE_TYPE.match(self._source[i])
        if self.col_match is not None:
            self.section = "types"
            self.el_type = CustomType
            self.el_name = self.col_match.group("name")
           
            return True
        else:
            return False
961347
public TypeName findParameterTypeByAliasOrName(String name) {
		if (parameterAlias2NameField.containsKey(name)) {
			return findParameterType(parameterAlias2NameField.get(name));
		}

		return findParameterType(name);
	}
827882
def _get_names(names, types):
    
    if types == "":
        try:
            names, types = names.split(":")
        except:
            pass
    return names.split(","), types
116415
def look_up(name):
    """"""
    path = name.split('.')
    module = import_module('.'.join(path[:-1]))
    return getattr(module, path[-1])
601062
def infer_typing_attr(node, context=None):
    """"""
    try:
        value = next(node.value.infer())
    except InferenceError as exc:
        raise UseInferenceDefault from exc

    if not value.qname().startswith("typing."):
        raise UseInferenceDefault

    node = extract_node(TYPING_TYPE_TEMPLATE.format(value.qname().split(".")[-1]))
    return node.infer(context=context)