Extract the actual Type to be used for a containing annotation.
175405
private Type extractContainingType(Attribute.Compound ca,
                                       DiagnosticPosition pos,
                                       TypeSymbol annoDecl)
    {
        // The next three checks check that the Repeatable annotation
        // on the declaration of the annotation type that is repeating is
        // valid.

        // Repeatable must have at least one element
        if (ca.values.isEmpty()) {
            log.error(pos, "invalid.repeatable.annotation", annoDecl);
            return null;
        }
        Pair<MethodSymbol,Attribute> p = ca.values.head;
        Name name = p.fst.name;
        if (name != names.value) { // should contain only one element, named "value"
            log.error(pos, "invalid.repeatable.annotation", annoDecl);
            return null;
        }
        if (!(p.snd instanceof Attribute.Class)) { // check that the value of "value" is an Attribute.Class
            log.error(pos, "invalid.repeatable.annotation", annoDecl);
            return null;
        }

        return ((Attribute.Class)p.snd).getValue();
    }
44200
def get_content_type(*names):
    """"""
    for name in names:
        if name is not None:
            mimetype, encoding = mimetypes.guess_type(name)
            if mimetype is not None:
                if isinstance(mimetype, bytes):
                    return mimetype.decode("ascii")
                else:
                    return mimetype
    else:
        return "application/octet-stream"
998606
def get_human_readable_type(item):
    """"""
    if isinstance(item, (ndarray, MaskedArray)):
        return item.dtype.name
    elif isinstance(item, Image):
        return "Image"
    else:
        text = get_type_string(item)
        if text is None:
            text = to_text_string('unknown')
        else:
            return text[text.find('.')+1:]
1237972
public String getAnnotType() {
    if (DictTerm_Type.featOkTst && ((DictTerm_Type)jcasType).casFeat_annotType == null)
      jcasType.jcas.throwFeatMissing("annotType", "ch.epfl.bbp.uima.types.DictTerm");
    return jcasType.ll_cas.ll_getStringValue(addr, ((DictTerm_Type)jcasType).casFeatCode_annotType);}
26178
def extract_types(cls, schema):
        
        for field in cls.extract_fields(schema):
            if field.has_format:
                yield field.format_spec.type
1168025
def annotation(self, type, set=None):
        """"""
        l = list(self.select(type,set,True,default_ignore_annotations))
        if len(l) >= 1:
            return l[0]
        else:
            raise NoSuchAnnotation()
208008
def get_type(obj, **kwargs):
    """"""
    t = type(obj)

    s = extract_type(str(t))

    return 'Type: {}'.format(s)
1082813
@Nullable
  private static <A extends Annotation> A getAnnotation(PropertyDescriptor descriptor,
      Class<A> type) {
    A a = null;
    if (descriptor.getWriteMethod() != null) {
      a = descriptor.getWriteMethod().getAnnotation(type);
    }
    if (a == null && descriptor.getReadMethod() != null) {
      a = descriptor.getReadMethod().getAnnotation(type);
    }
    return a;
  }
243059
private Type parseNominalType(EnclosingScope scope) {
		int start = index;
		Name name = parseName(scope);
		if (name.size() == 1 && scope.isTypeVariable(name.get(0))) {
			return annotateSourceLocation(new Type.Variable(name.get(0)), start);
		} else {
			Tuple<Type> types = parseTypeParameters(scope);
			return annotateSourceLocation(new Type.Nominal(new Decl.Link(name),types), start);
		}
	}
990151
static void extractString(Elements elementUtils, Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
		extractAttributeValue(elementUtils, item, annotationClass.getCanonicalName(), attribute, listener);
	}
28855
def jsondeclarations(self):
        
        l = []
        for annotationtype, set in self.annotations:
            label = None
            #Find the 'label' for the declarations dynamically (aka: AnnotationType --> String)
            for key, value in vars(AnnotationType).items():
                if value == annotationtype:
                    label = key
                    break
            #gather attribs

            if (annotationtype == AnnotationType.TEXT or annotationtype == AnnotationType.PHON) and set == 'undefined' and len(self.annotationdefaults[annotationtype][set]) == 0:
                #this is the implicit TextContent declaration, no need to output it explicitly
                continue

            jsonnode = {'annotationtype': label.lower()}
            if set and set != 'undefined':
                jsonnode['set'] = set


            for key, value in self.annotationdefaults[annotationtype][set].items():
                if key == 'annotatortype':
                    if value == AnnotatorType.MANUAL:
                        jsonnode[key] = 'manual'
                    elif value == AnnotatorType.AUTO:
                        jsonnode[key] = 'auto'
                elif key == 'datetime':
                    jsonnode[key] = value.strftime("%Y-%m-%dT%H:%M:%S") #proper iso-formatting
                elif value:
                    jsonnode[key] = value
            if label:
                l.append( jsonnode  )
            else:
                raise Exception("Invalid annotation type")
        return l
718192
function _getTypeAnnotation() {
  var node = this.node;

  if (!node) {
    // handle initializerless variables, add in checks for loop initializers too
    if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
      var declar = this.parentPath.parentPath;
      var declarParent = declar.parentPath;

      // for (var NODE in bar) {}
      if (declar.key === "left" && declarParent.isForInStatement()) {
        return t.stringTypeAnnotation();
      }

      // for (var NODE of bar) {}
      if (declar.key === "left" && declarParent.isForOfStatement()) {
        return t.anyTypeAnnotation();
      }

      return t.voidTypeAnnotation();
    } else {
      return;
    }
  }

  if (node.typeAnnotation) {
    return node.typeAnnotation;
  }

  var inferer = inferers[node.type];
  if (inferer) {
    return inferer.call(this, node);
  }

  inferer = inferers[this.parentPath.type];
  if (inferer && inferer.validParent) {
    return this.parentPath.getTypeAnnotation();
  }
}
804305
protected MatchType getMatchType(TypeName m) {
    return match(m)
        .when(typeOf(ParameterizedTypeName.class)).get(
            t -> {
              if (isDecomposableBuilder(t.rawType)) {
                return MatchType.DECOMPOSE;
              } else if (t.rawType.equals(MATCH_ANY)) {
                return MatchType.ANY;
              } else if (t.rawType.equals(MATCH_EXACT)) {
                return MatchType.EXACT;
              } else {
                return MatchType.EXACT;
              }
            })
        .when(typeOf(TypeVariableName.class)).get(t -> MatchType.EXACT)
        .orElse(MatchType.ANY)
        .getMatch();
  }
803535
public Map<String, String> extractTypes(XTrace trace) {
		return XCostType.instance().extractValues(trace);
	}
1251159
def type(self):
        """"""
        if self.__type is None:
            found_type = find_definition(
                self.__type_name, self.message_definition())
            if not (found_type is not Enum and
                    isinstance(found_type, type) and
                    issubclass(found_type, Enum)):
                raise FieldDefinitionError(
                    'Invalid enum type: %s' % found_type)

            self.__type = found_type
        return self.__type
234198
def extern_get_type_for(self, context_handle, val):
    """"""
    c = self._ffi.from_handle(context_handle)
    obj = self._ffi.from_handle(val[0])
    type_id = c.to_id(type(obj))
    return TypeId(type_id)
1242729
def get_import_for_type(t):
    """"""
    t_as_string = to_str(t)
    if not is_identifier(t_as_string):
        # this class expanded into something other than a single identifier
        # we can ignore it.  This is the case when we encounter something
        # like the configman.converter.str_to_classes_in_namespaces
        # InnerClassList.  We can safely ignore these things here.
        return (None, None)
    if '.' in t_as_string:
        parts = t_as_string.split('.')
        return ('.'.join(parts[:-1]), parts[-1])
    else:
        if t_as_string in known_mapping_str_to_type:
            return (None, None)
        return (None, t_as_string)