Replace references to named typed with the actual types.
161211
def realize_input_schema(input_types,  # type: MutableSequence[Dict[Text, Any]]
                         schema_defs   # type: Dict[Text, Any]
                        ):  # type: (...) -> MutableSequence[Dict[Text, Any]]
    """"""
    for index, entry in enumerate(input_types):
        if isinstance(entry, string_types):
            if '#' in entry:
                _, input_type_name = entry.split('#')
            else:
                input_type_name = entry
            if input_type_name in schema_defs:
                entry = input_types[index] = schema_defs[input_type_name]
        if isinstance(entry, collections.Mapping):
            if isinstance(entry['type'], string_types) and '#' in entry['type']:
                _, input_type_name = entry['type'].split('#')
                if input_type_name in schema_defs:
                    input_types[index]['type'] = realize_input_schema(
                        schema_defs[input_type_name], schema_defs)
            if isinstance(entry['type'], collections.MutableSequence):
                input_types[index]['type'] = realize_input_schema(
                    entry['type'], schema_defs)
            if isinstance(entry['type'], collections.Mapping):
                input_types[index]['type'] = realize_input_schema(
                    [input_types[index]['type']], schema_defs)
            if entry['type'] == 'array':
                items = entry['items'] if \
                    not isinstance(entry['items'], string_types) else [entry['items']]
                input_types[index]['items'] = realize_input_schema(items, schema_defs)
            if entry['type'] == 'record':
                input_types[index]['fields'] = realize_input_schema(
                    entry['fields'], schema_defs)
    return input_types
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_
796616
public void makeSameAs(UnconditionalValueDerefSet source) {
        // Copy value numbers
        valueNumbersUnconditionallyDereferenced.clear();
        valueNumbersUnconditionallyDereferenced.or(source.valueNumbersUnconditionallyDereferenced);
        lastUpdateTimestamp = source.lastUpdateTimestamp;
        // Copy dereference locations for each value number
        derefLocationSetMap.clear();
        if (source.derefLocationSetMap.size() > 0) {
            for (Map.Entry<ValueNumber, Set<Location>> sourceEntry : source.derefLocationSetMap.entrySet()) {
                Set<Location> derefLocationSet = Util.makeSmallHashSet(sourceEntry.getValue());
                derefLocationSetMap.put(sourceEntry.getKey(), derefLocationSet);
            }
        }
    }
16903
def _dict_refs(obj, named):
    '''
    '''
    if named:
        for k, v in _items(obj):
            s = str(k)
            yield _NamedRef('[K] ' + s, k)
            yield _NamedRef('[V] ' + s + ': ' + _repr(v), v)
    else:
        for k, v in _items(obj):
            yield k
            yield v
300688
def typed(cls):
    
    for name, attr in _typed_from_items(vars(cls).items()).items():
        setattr(cls, name, attr)
    return cls
1047954
public void translateInnerClasses ()
    {
        ImportSet inner = new ImportSet();
        Iterator<String> i = _imports.iterator();
        while (i.hasNext()) {
            String name = i.next();
            int dollar = name.indexOf('$');
            if (dollar >= 0) {
                i.remove();
                inner.add(name.replace('$', '_'));
            }
        }

        addAll(inner);
    }
1202550
function toTypeRef(type) {
    if (!type) {
      return (0, _typeOf.typeOf)(type);
    } else if (type.constructor === String || type instanceof Function) {
      return type;
    }

    return (0, _typeOf.typeOf)(type);
  }
587344
@SuppressWarnings("unchecked")
	protected void removeCurrentTypeConversion() {
		final IStructuredSelection selection = this.list.getStructuredSelection();
		final String[] types = new String[selection.size()];
		final Iterator<ConversionMapping> iter = selection.iterator();
		int i = 0;
		while (iter.hasNext()) {
			types[i] = iter.next().getSource();
			i++;
		}
		removeTypeConversions(types);
	}
30374
def replace_type(items, spec, loader, found, find_embeds=True, deepen=True):
    # type: (Any, Dict[Text, Any], Loader, Set[Text], bool, bool) -> Any
    

    if isinstance(items, MutableMapping):
        # recursively check these fields for types to replace
        if items.get("type") in ("record", "enum") and items.get("name"):
            if items["name"] in found:
                return items["name"]
            found.add(items["name"])

        if not deepen:
            return items

        items = copy.copy(items)
        if not items.get("name"):
            items["name"] = get_anon_name(items)
        for name in ("type", "items", "fields"):
            if name in items:
                items[name] = replace_type(
                    items[name], spec, loader, found, find_embeds=find_embeds,
                    deepen=find_embeds)
                if isinstance(items[name], MutableSequence):
                    items[name] = flatten(items[name])

        return items
    if isinstance(items, MutableSequence):
        # recursively transform list
        return [replace_type(i, spec, loader, found, find_embeds=find_embeds,
                             deepen=deepen) for i in items]
    if isinstance(items, string_types):
        # found a string which is a symbol corresponding to a type.
        replace_with = None
        if items in loader.vocab:
            # If it's a vocabulary term, first expand it to its fully qualified
            # URI
            items = loader.vocab[items]

        if items in spec:
            # Look up in specialization map
            replace_with = spec[items]

        if replace_with:
            return replace_type(replace_with, spec, loader, found, find_embeds=find_embeds)
        found.add(items)
    return items
434529
private Collection<Class<? extends Saga>> removeAbstractTypes(final Collection<Class<? extends Saga>> foundTypes) {
        Collection<Class<? extends Saga>> sagaTypes = new ArrayList<>();

        for (Class<? extends Saga> entryType : foundTypes) {
            if (!Modifier.isAbstract(entryType.getModifiers())) {
                sagaTypes.add(entryType);
            }
        }

        return sagaTypes;
    }
983668
def c_typedefs(self):
        """"""
        defs = []
        attrs = self.opts.attrs + '\n' if self.opts.attrs else ''
        for name, args in self.funcs:
            logging.debug('name: %s args: %s', name, args)
            defs.append(
                'typedef\n{}\n{}{}({});\n'.format(
                    args[0], attrs,
                    self._c_type_name(name), make_c_args(args[2])
                )
            )
        return defs
722700
def _reset_kind_map(cls):
    """"""
    # Preserve "system" kinds, like __namespace__
    keep = {}
    for name, value in cls._kind_map.iteritems():
      if name.startswith('__') and name.endswith('__'):
        keep[name] = value
    cls._kind_map.clear()
    cls._kind_map.update(keep)
1247716
def update_attributes(self, **kwargs):
        """"""
        attrs = self.attributes.values() + self.lists.values() \
                + self.references.values()
        for att in attrs:
            if att.name in kwargs:
                att.__set__(self, kwargs[att.name])
416143
def children_types( record, index, key='refs', stop_types=STOP_TYPES ):
    """"""
    types = {}
    for child in children( record, index, key, stop_types=stop_types ):
        types.setdefault(child['type'],[]).append( child )
    return types
1294227
def register_type(cls, name):
    """"""
    x = TypeDefinition(name, (cls,), ())
    Validator.types_mapping[name] = x
253656
public function replaceTemplateTypesWithStandins(
        array &$template_types,
        array &$generic_params,
        Codebase $codebase = null,
        Atomic $input_type = null,
        bool $replace = true,
        bool $add_upper_bound = false,
        int $depth = 0
    ) {
        foreach ($this->properties as $offset => $property) {
            $input_type_param = null;

            if ($input_type instanceof Atomic\ObjectLike
                && isset($input_type->properties[$offset])
            ) {
                $input_type_param = $input_type->properties[$offset];
            }

            $property->replaceTemplateTypesWithStandins(
                $template_types,
                $generic_params,
                $codebase,
                $input_type_param,
                $replace,
                $add_upper_bound,
                $depth
            );
        }
    }
815659
def named_refs(obj):
    
    refs = []
    v = _typedefof(obj)
    if v:
        v = v.refs
        if v and _callable(v):
            for ref in v(obj, True):
                try:
                    refs.append((ref.name, ref.ref))
                except AttributeError:
                    pass
    return refs