TypeMirror.toString() isn't guaranteed to remain the same.
543933
private String computeClassHash(Iterable<AutoValueProcessor.Property> props, String pkg) {
    CRC32 crc = new CRC32();
    String encodedType = TypeEncoder.encode(type.asType()) + ":";
    String decodedType = TypeEncoder.decode(encodedType, processingEnv, "", null);
    if (!decodedType.startsWith(pkg)) {
      // This is for compatibility with the way an earlier version did things. Preserving hash
      // codes probably isn't vital, since client and server should be in sync.
      decodedType = pkg + "." + decodedType;
    }
    crc.update(decodedType.getBytes(UTF_8));
    for (AutoValueProcessor.Property prop : props) {
      String encodedProp = prop + ":" + TypeEncoder.encode(prop.getTypeMirror()) + ";";
      String decodedProp = TypeEncoder.decode(encodedProp, processingEnv, pkg, null);
      crc.update(decodedProp.getBytes(UTF_8));
    }
    return String.format("%08x", crc.getValue());
  }
1158691
public static <T extends MethodDescription> ElementMatcher.Junction<T> isToString() {
        return named("toString").and(takesArguments(0)).and(returns(TypeDescription.STRING));
    }
426808
Object toSimpleValue(Class<?> genericType, Object element, TypeAdapters typeAdapters) {
        if (element == null) {
            return null;
        }
        log.info("Convert from " + element.getClass().getName() + " to " + genericType.getName());
        if (genericType.isEnum() && (element instanceof String)) {
            @SuppressWarnings({ "unchecked", "rawtypes" })
            Enum<?> enumValue = Enum.valueOf((Class<? extends Enum>) genericType, (String) element);
            return enumValue;
        }
        Converter converter = SIMPLE_VALUE_CONVERTERS.get(genericType.getName());
        if (converter != null) {
            return converter.convert(element);
        }
        if ((element instanceof String) && (typeAdapters != null)) {
            TypeAdapter<?> adapter = typeAdapters.getTypeAdapter(genericType);
            if (adapter != null) {
                return adapter.deserialize((String) element);
            }
        }
        return element;
    }
1084495
private TypeDescriptor makeTypeDescriptor(final TypeMirror type) {
    if (type.getKind() != TypeKind.DECLARED) {
      return new TypeDescriptor(type.toString(), ImmutableList.<TypeDescriptor>of());
    }
    final DeclaredType dt = (DeclaredType) type;

    final String plainType = processingEnv.getTypeUtils().erasure(type).toString();
    final List<TypeDescriptor> typeArgumentsList = Lists.newArrayList();
    final List<? extends TypeMirror> typeArguments = dt.getTypeArguments();
    for (final TypeMirror arg : typeArguments) {
      typeArgumentsList.add(makeTypeDescriptor(arg));
    }
    return new TypeDescriptor(plainType, typeArgumentsList);
  }
1163629
function(type){
            type = this.string(type);
            if(types.indexOf(type.toLowerCase()) < 0){
                throw new TypeError('a type in [' + types.join(', ') + '] is expected, but ' + type + ' given');
            }
            return type.toLowerCase();
        }
155682
private String getClassName(final TypeMirror t) {
        String res = null;

        if (t instanceof DeclaredType) {
            final DeclaredType dt = (DeclaredType) t;
            res = ((TypeElement) dt.asElement()).getQualifiedName().toString();
            if (!dt.getTypeArguments().isEmpty()) {
                res += "<";
                boolean first = true;
                for (final TypeMirror tm : dt.getTypeArguments()) {
                    if (first) {
                        first = false;
                    } else {
                        res += ",";
                    }
                    res += getClassName(tm);
                }
                res += ">";
            }

        } else if (t instanceof PrimitiveType) {
            res = ((PrimitiveType) t).toString();
        }

        return res;
    }
355448
private String getTypeString(final Type type) {
        if (type == null) return null;
        switch (type) {
            case ERROR:
                return "ERROR";
            case INFO:
                return "INFO";
            case WARN:
                return "WARN";
            case DEBUG:
                return "DEBUG";
        }
        return null;
    }
773851
static boolean isRawType(TypeMirror typeMirror) {
    Set<TypeParameterElement> visited = new HashSet<>();
    return typeMirror.accept(CheckRawTypesVisitor.INSTANCE, visited);
  }
63554
function sameType(a, b) {
  a = Object.prototype.toString.call(a);
  b = Object.prototype.toString.call(b);
  return a == b;
}
1124505
@Requires("type != null")
  @Ensures("result == null || result.getDeclaredName().equals(type.toString())")
  TypeName getTypeNameForType(TypeMirror type) {
    switch (type.getKind()) {
      case NONE:
        return null;
      default:
        return new TypeName(type.toString());
    }
  }
708002
public static TypeName typeName(TypeMirror typeMirror) {
		LiteralType literalType = LiteralType.of(typeMirror.toString());

		if (literalType.isArray()) {
			return ArrayTypeName.of(typeName(literalType.getRawType()));
		} else if (literalType.isCollection()) {
			return ParameterizedTypeName.get(TypeUtility.className(literalType.getRawType()),
					typeName(literalType.getTypeParameter()));
		}

		TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
				TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };

		for (TypeName item : values) {
			if (typeMirror.toString().equals(item.toString())) {
				return item;
			}
		}

		return TypeName.get(typeMirror);
	}
537086
final void checkReturnType(TypeElement autoValueClass, ExecutableElement getter) {
    TypeMirror type = getter.getReturnType();
    if (type.getKind() == TypeKind.ARRAY) {
      TypeMirror componentType = ((ArrayType) type).getComponentType();
      if (componentType.getKind().isPrimitive()) {
        warnAboutPrimitiveArrays(autoValueClass, getter);
      } else {
        errorReporter.reportError(
            "An @"
                + simpleAnnotationName
                + " class cannot define an array-valued property unless it is a primitive array",
            getter);
      }
    }
  }
476010
function typof (v) {
  var s = Object.prototype.toString.call(v);
  return s.substring(8, s.length - 1).toLowerCase()
}
571655
private static String getSignature(TypeMirror type) {
        StringBuilder sbuf = new StringBuilder();
        type.accept(new SimpleTypeVisitor7<Void, StringBuilder>() {
            @Override
            protected Void defaultAction(TypeMirror e, StringBuilder stringBuilder) {
                return null;
            }

            @Override
            public Void visitPrimitive(PrimitiveType t, StringBuilder stringBuilder) {
                switch (t.getKind()) {
                    case BOOLEAN:
                        stringBuilder.append("Z");
                        break;
                    case BYTE:
                        stringBuilder.append("B");
                        break;
                    case CHAR:
                        stringBuilder.append("C");
                        break;
                    case DOUBLE:
                        stringBuilder.append("D");
                        break;
                    case FLOAT:
                        stringBuilder.append("F");
                        break;
                    case INT:
                        stringBuilder.append("I");
                        break;
                    case LONG:
                        stringBuilder.append("J");
                        break;
                    case SHORT:
                        stringBuilder.append("S");
                        break;
                    default:
                        break;
                }

                return null;
            }

            @Override
            public Void visitArray(ArrayType t, StringBuilder stringBuilder) {
                stringBuilder.append("[");
                t.getComponentType().accept(this, stringBuilder);
                return null;
            }

            @Override
            public Void visitDeclared(DeclaredType t, StringBuilder stringBuilder) {
                stringBuilder.append("L");
                stringBuilder.append(((TypeElement) t.asElement()).getQualifiedName().toString().replace('.', '/'));
                stringBuilder.append(";");

                return null;
            }

            @Override
            public Void visitExecutable(ExecutableType t, StringBuilder stringBuilder) {
                stringBuilder.append("(");
                for (TypeMirror p : t.getParameterTypes()) {
                    p.accept(this, stringBuilder);
                }
                stringBuilder.append(")");
                t.getReturnType().accept(this, stringBuilder);

                return null;
            }

            @Override
            public Void visitNoType(NoType t, StringBuilder stringBuilder) {
                if (t.getKind() == TypeKind.VOID) {
                    stringBuilder.append("V");
                }

                return null;
            }
        }, sbuf);

        return sbuf.toString();
    }
473889
static TypeKey get(TypeMirror type) {
    Set<TypeParameterElement> visited = new HashSet<>();
    return type.accept(TypeKeyVisitor.INSTANCE, visited);
  }
423312
function type(input) {

  //If the input value is null, undefined or NaN the toStringTypes object shouldn't be used
  if (input === null || input === undefined || (input !== input && String(input) === "NaN")) {
    return String(input);
  }

  // use the typeMap to detect the type and fallback to object if the type wasn't found
  return typeMap[Object.prototype.toString.call(input)] || "object";
}
1211186
def getTypeStr(_type):
  
  """
  if isinstance(_type, CustomType):
    return str(_type)

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

  return ''