Gets all symbols associated with the given type. For union types, this may be multiple symbols.
For instance types, this will return the constructor of that instance.
973488
public List<Symbol> getAllSymbolsForType(JSType type) {
    if (type == null) {
      return ImmutableList.of();
    }

    UnionType unionType = type.toMaybeUnionType();
    if (unionType != null) {
      List<Symbol> result = new ArrayList<>(2);
      for (JSType alt : unionType.getAlternates()) {
        // Our type system never has nested unions.
        Symbol altSym = getSymbolForTypeHelper(alt, true);
        if (altSym != null) {
          result.add(altSym);
        }
      }
      return result;
    }
    Symbol result = getSymbolForTypeHelper(type, true);
    return result == null ? ImmutableList.of() : ImmutableList.of(result);
  }
878937
public Set<Constructor> getConstructorsMatchParams(Class<?>... types) {
        return getConstructorsFromDescriptors(store.get(index(MethodParameterScanner.class), names(types).toString()), loaders());
    }
1319133
public Symbol getSymbolForScope(SymbolScope scope) {
    if (scope.getSymbolForScope() == null) {
      scope.setSymbolForScope(findSymbolForScope(scope));
    }
    return scope.getSymbolForScope();
  }
624405
private static List<TypeVariableSymbol> typeVariablesEnclosing(Symbol sym) {
    List<TypeVariableSymbol> typeVarScopes = new ArrayList<>();
    outer:
    while (!sym.isStatic()) {
      sym = sym.owner;
      switch (sym.getKind()) {
        case PACKAGE:
          break outer;
        case METHOD:
        case CLASS:
          typeVarScopes.addAll(sym.getTypeParameters());
          break;
        default: // fall out
      }
    }
    return typeVarScopes;
  }
1209593
public static Class[] getImplementorClasses( Class interfaceType )
    {
        String interfaceName = interfaceType.getName();
        ArrayList/*< Class >*/ classes = new ArrayList/*< Class >*/();
        ClassLoader classLoader = getClassLoader();
        
        try
        {
            Enumeration e = classLoader.getResources( "META-INF/services/" + interfaceName );
            
            while ( e.hasMoreElements() )
            {
                URL url = ( URL ) e.nextElement();
                
                if ( _log.isTraceEnabled() )
                {
                    _log.trace( "Found implementor entry for interface " + interfaceName + " at " + url );
                }
                
                InputStream is = null;
                String className = null;
                
                try
                {
                    is = url.openStream();
                    BufferedReader reader = new BufferedReader( new InputStreamReader( is ) );
                    className = reader.readLine().trim();
                    Class implementorClass = loadImplementorClass( className, interfaceType, classLoader );
                    if ( implementorClass != null ) classes.add( implementorClass );
                }
                catch ( IOException ioe )
                {
                    _log.error( "Could not read implementor class entry at + " + url );
                }
                finally
                {
                    if ( is != null ) is.close();
                }
            }
        }
        catch ( IOException e )
        {
            _log.error( "Could not discover implementors for " + interfaceName, e );
        }
        
        return ( Class[] ) classes.toArray( new Class[0] );
    }
931022
def _get_chain_parent_symbol(self, symbol, fullsymbol):
        """"""
        #We are only interested in the type of the variable immediately preceding our symbol
        #in the chain so we can list its members.
        chain = fullsymbol.split("%")

        #We assume that if symbol != fullsymbol, we have at least a % at the end that 
        #tricked the symbol regex.
        if len(chain) < 2:
            return ([], None)
        previous = chain[-2].lower()

        #Now we need to use the name of the variable to find the actual type name
        target_name = ""
        if previous in self.element.members:
            target_name = self.element.members[previous].kind
        #The contextual element could be a module, in which case it has no parameters
        if hasattr(self.element, "parameters") and previous in self.element.parameters:
            target_name = self.element.parameters[previous].kind

        if target_name == "":
            return (None, None)

        return self.context.parser.tree_find(target_name, self.context.module, "types")
401871
private ImmutableSet<JSType> getTypesToSkipForType(JSType type) {
    type = type.restrictByNotNullOrUndefined();
    if (type.isUnionType()) {
      ImmutableSet.Builder<JSType> types = ImmutableSet.builder();
      types.add(type);
      for (JSType alt : type.getUnionMembers()) {
        types.addAll(getTypesToSkipForTypeNonUnion(alt));
      }
      return types.build();
    } else if (type.isEnumElementType()) {
      return getTypesToSkipForType(type.getEnumeratedTypeOfEnumElement());
    }
    return ImmutableSet.copyOf(getTypesToSkipForTypeNonUnion(type));
  }
713775
public <T> TypeAdapter<T> getAdapter(Class<T> type) {
    return getAdapter(TypeToken.get(type));
  }
368083
public static List<Field> getAllFields(Class<?> type) {
        List<Field> fields = new ArrayList<>();

        for (Class<?> currentType = type; currentType != null; currentType = currentType.getSuperclass()) {
            fields.addAll(Arrays.asList(currentType.getDeclaredFields()));
        }

        return fields;
    }
1073455
function findType (type) {
  let name = ''
  const defaultTypes = [
    'string',
    'number',
    'boolean',
    'symbol',
    'array',
    'object'
  ]

  try {
    name = type.prototype.constructor.name.toLowerCase()
  } catch (err) {}

  if (defaultTypes.includes(name)) {
    return types[name]()
  }

  return value => {
    if (!(value instanceof type)) {
      throw new Error(`is not instance of ${type.prototype.constructor.name}`)
    }

    return true
  }
}
902111
Symbol findGlobalType(Env<AttrContext> env, Scope scope, Name name, RecoveryLoadClass recoveryLoadClass) {
        Symbol bestSoFar = typeNotFound;
        for (Symbol s : scope.getSymbolsByName(name)) {
            Symbol sym = loadClass(env, s.flatName(), recoveryLoadClass);
            if (bestSoFar.kind == TYP && sym.kind == TYP &&
                bestSoFar != sym)
                return new AmbiguityError(bestSoFar, sym);
            else
                bestSoFar = bestOf(bestSoFar, sym);
        }
        return bestSoFar;
    }
1283874
public List<Symbol> functionalInterfaceBridges(TypeSymbol origin) {
        Assert.check(isFunctionalInterface(origin));
        Symbol descSym = findDescriptorSymbol(origin);
        CompoundScope members = membersClosure(origin.type, false);
        ListBuffer<Symbol> overridden = new ListBuffer<>();
        outer: for (Symbol m2 : members.getElementsByName(descSym.name, bridgeFilter)) {
            if (m2 == descSym) continue;
            else if (descSym.overrides(m2, origin, Types.this, false)) {
                for (Symbol m3 : overridden) {
                    if (isSameType(m3.erasure(Types.this), m2.erasure(Types.this)) ||
                            (m3.overrides(m2, origin, Types.this, false) &&
                            (pendingBridges((ClassSymbol)origin, m3.enclClass()) ||
                            (((MethodSymbol)m2).binaryImplementation((ClassSymbol)m3.owner, Types.this) != null)))) {
                        continue outer;
                    }
                }
                overridden.add(m2);
            }
        }
        return overridden.toList();
    }
789535
def find_all(lookup)
      case lookup
      when ::Module
        each_node.grep(lookup)
      when ::Symbol
        each_node.find_all { |n| n.type == lookup }
      when ::String
        each_node.find_all { |n| n.source == lookup }
      when ::Regexp
        each_node.find_all { |n| n.source =~ lookup }
      else
        raise ::TypeError, "Expected class or symbol, got #{lookup.class}: #{lookup.inspect}"
      end
    end
271736
def get_by_symbol(self, symbol: str) -> Commodity:
        
        # handle namespace. Accept GnuCash and Yahoo-style symbols.
        full_symbol = self.__parse_gc_symbol(symbol)

        query = (
            self.query
            .filter(Commodity.mnemonic == full_symbol["mnemonic"])
        )
        if full_symbol["namespace"]:
            query = query.filter(Commodity.namespace == full_symbol["namespace"])

        return query.first()
120110
def _ExtractSymbols(self, descriptors):
    

    for desc in descriptors:
      yield (_PrefixWithDot(desc.full_name), desc)
      for symbol in self._ExtractSymbols(desc.nested_types):
        yield symbol
      for enum in desc.enum_types:
        yield (_PrefixWithDot(enum.full_name), enum)
115187
@SuppressWarnings("static-method")
	protected List<JvmTypeParameter> getTypeParametersFor(XtendTypeDeclaration type) {
		if (type instanceof XtendClass) {
			return ((XtendClass) type).getTypeParameters();
		}
		if (type instanceof XtendInterface) {
			return ((XtendInterface) type).getTypeParameters();
		}
		return Collections.emptyList();
	}
896914
public String getSignature(TypeMirror type) {
    StringBuilder sb = new StringBuilder();
    buildTypeSignature(type, sb);
    return sb.toString();
  }