Returns the enclosing type, or null if this type is not nested in another type.
769592
public String enclosingTypeOrPackage() {
    int dot = string.lastIndexOf('.');
    return dot == -1 ? null : string.substring(0, dot);
  }
914027
public QualifiedName enclosingType() {
    checkState(!isTopLevel(), "Cannot return enclosing type of top-level type");
    return new QualifiedName(packageName, simpleNames.subList(0, simpleNames.size() - 1));
  }
463135
@Nullable
  private static JSType getInstanceIfPrototype(JSType maybePrototype) {
    if (maybePrototype.isFunctionPrototypeType()) {
      FunctionType constructor = maybePrototype.toObjectType().getOwnerFunction();
      if (constructor != null) {
        if (!constructor.hasInstanceType()) {
          // this can happen when adding to the prototype of a non-constructor function
          return null;
        }
        return constructor.getInstanceType();
      }
    }
    return null;
  }
1260833
public Type asEnclosingSuper(Type t, Symbol sym) {
        switch (t.getTag()) {
        case CLASS:
            do {
                Type s = asSuper(t, sym);
                if (s != null) return s;
                Type outer = t.getEnclosingType();
                t = (outer.hasTag(CLASS)) ? outer :
                    (t.tsym.owner.enclClass() != null) ? t.tsym.owner.enclClass().type :
                    Type.noType;
            } while (t.hasTag(CLASS));
            return null;
        case ARRAY:
            return isSubtype(t, sym.type) ? sym.type : null;
        case TYPEVAR:
            return asSuper(t, sym);
        case ERROR:
            return t;
        default:
            return null;
        }
    }
17126
public @CheckForNull <U extends T> U get(@Nonnull Class<U> type) {
        for (T ext : this)
            if(ext.getClass()==type)
                return type.cast(ext);
        return null;
    }
1134953
function getEnclosingFunction(node) {
    while  (node.type !== 'FunctionDeclaration' && 
            node.type !== 'FunctionExpression' && 
            node.type !== 'Program') {
        node = node.$parent;
    }
    return node;
}
184385
private Class getMapType()
  {
    Class mapType = Map.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        mapType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractMap.class).isAssignableFrom( newType ) )
      {
        mapType = AbstractMap.class;
      }
    }
    return mapType;
  }
645327
private static boolean memberOfEnclosing(Symbol owner, VisitorState state, Symbol sym) {
    if (sym == null || !sym.hasOuterInstance()) {
      return false;
    }
    for (ClassSymbol encl = owner.owner.enclClass();
        encl != null;
        encl = encl.owner != null ? encl.owner.enclClass() : null) {
      if (sym.isMemberOf(encl, state.getTypes())) {
        return true;
      }
    }
    return false;
  }
830784
private static TypeElement getEnclosingType(Element element) {
    return element.accept(new SimpleElementVisitor6<TypeElement, Void>() {
      @Override protected TypeElement defaultAction(Element e, Void p) {
        return e.getEnclosingElement().accept(this, p);
      }

      @Override public TypeElement visitType(TypeElement e, Void p) {
        return e;
      }

      @Override public TypeElement visitPackage(PackageElement e, Void p) {
        throw new IllegalArgumentException();
      }
    }, null);
  }
1135379
public TypeElement findParent(TypeElement typeElement, Set<TypeElement> parents) {
    TypeMirror type;
    while (true) {
      type = typeElement.getSuperclass();
      if (type.getKind() == TypeKind.NONE) {
        return null;
      }
      typeElement = (TypeElement) ((DeclaredType) type).asElement();
      if (containsTypeMirror(parents, type)) {
        return typeElement;
      }
    }
  }
429506
@Nullable
  public static Type getType(@Nullable Tree tree) {
    return tree instanceof JCTree ? ((JCTree) tree).type : null;
  }
1128588
public String getType()
    {
    IVarDef parent = getParent();
    return parent==null? type_ : parent.getType();
    }
77928
public Class<?> getNestedParameterType() {
        if (this.nestingLevel > 1) {
            Type type = getGenericParameterType();
            for (int i = 2; i <= this.nestingLevel; i++) {
                if (type instanceof ParameterizedType) {
                    Type[] args = ((ParameterizedType) type).getActualTypeArguments();
                    Integer index = getTypeIndexForLevel(i);
                    type = args[index != null ? index : args.length - 1];
                }
            }
            if (type instanceof Class) {
                return (Class<?>) type;
            } else if (type instanceof ParameterizedType) {
                Type arg = ((ParameterizedType) type).getRawType();
                if (arg instanceof Class) {
                    return (Class<?>) arg;
                }
            }
            return Object.class;
        } else {
            return getParameterType();
        }
    }
1074280
public AbstractType<?> getAbstractType() {
        if (abstractType != null) {
            return abstractType;
        }

        try {

            if (validatorKind == Kind.NOT_A_COLLECTION) {
                abstractType = MAP_ABSTRACT_TYPE_CLASS_TO_ABSTRACT_TYPE.get(forName
                        (validatorClassName));

            } else {
                throw new DeepGenericException("Cannot determine collection kind for " + validatorKind);

            }

        } catch (ClassNotFoundException e) {
            throw new DeepGenericException(e);
        }

        return abstractType;
    }
1220835
@Override
	protected Type getTypeToSerialize() {

		if (contentType != null) {

			switch (contentType) {

				case "application/x-structr-javascript":
				case "application/x-structr-script":
					return Type.Function;

				case "application/x-cypher":
					return Type.Cypher;

			}
		}

		return Type.Function;
	}
407790
@Nonnull
  public static <ELEMENTTYPE> Enumeration <ELEMENTTYPE> getEnumeration (@Nullable final Iterator <ELEMENTTYPE> aIter)
  {
    if (aIter == null)
      return new EmptyEnumeration <> ();
    return new EnumerationFromIterator <> (aIter);
  }
677023
def get_nullable_type(type_):  # noqa: F811
    """"""
    if is_non_null_type(type_):
        type_ = cast(GraphQLNonNull, type_)
        type_ = type_.of_type
    return cast(Optional[GraphQLNullableType], type_)