Get an annotation object
485473
def _get_objanno(self, assoc_fn):
        """"""
        # Determine annotation file format from filename, if possible
        anno_type = get_anno_desc(assoc_fn, None)
        # Default annotation file format is id2gos
        if anno_type is None:
            anno_type = self.args.annofmt if self.args.annofmt else 'id2gos'
        kws = {'taxid': self.args.taxid} if anno_type == 'gene2go' else {}
        return get_objanno(assoc_fn, anno_type, **kws)
290188
public static final <T extends Annotation> T getAnnotation(Object bean, String property, Class<T> annotationClass)
    {
        return (T) doFor(
            bean, 
            property, 
            null,
            (Object a, int i)->{Object o=Array.get(a, i);return o!=null?o.getClass().getAnnotation(annotationClass):null;},
            (List l, int i)->{return l.get(i).getClass().getAnnotation(annotationClass);},
            (Object b, Class c, String p)->{return getField(c, p).getAnnotation(annotationClass);}, 
            (Object b, Method m)->{return m.getAnnotation(annotationClass);});
    }
871967
public static <A extends Annotation> A getAnnotation(Field field, Class<A> annotationType) {
        if (field == null || annotationType == null) {
            return null;
        }

        return field.getAnnotation(annotationType);
    }
1332054
def get_annotated_fields(cls, instance, select=lambda *p: True):
        

        result = {}

        for _, member in getmembers(instance):
            try:
                annotations = cls.get_annotations(
                    target=member, ctx=instance, select=select
                )

            except TypeError:
                pass

            else:
                try:
                    if annotations:
                        result[member] = annotations

                except TypeError:  # if field is an object proxy
                    pass

        return result
840502
@SuppressWarnings("unchecked")
    public <T> List<T> getAnnotations(final Class<? extends Annotation> clazz) {
        return (List<T>) foundAnnotations.get(clazz);
    }
1037016
@DefinedBy(Api.LANGUAGE_MODEL)
    public <A extends Annotation> A getAnnotation(Class<A> annoType) {

        if (!annoType.isAnnotation())
            throw new IllegalArgumentException("Not an annotation type: " + annoType);

        Attribute.Compound c = getAttribute(annoType);
        return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
    }
565094
private String getAnnotations(Annotate annotator, String stringFromClient)
      throws JDOMException, IOException {
    // get a breader from the string coming from the client
    BufferedReader clientReader = new BufferedReader(
        new StringReader(stringFromClient));
    KAFDocument kaf = KAFDocument.createFromStream(clientReader);
    KAFDocument.LinguisticProcessor newLp = kaf.addLinguisticProcessor(
        "entities", "ixa-pipe-nerc-" + Files.getNameWithoutExtension(model),
        version + "-" + commit);
    newLp.setBeginTimestamp();
    annotator.annotateNEsToKAF(kaf);
    // get outputFormat
    String kafToString = null;
    if (outputFormat.equalsIgnoreCase("conll03")) {
      kafToString = annotator.annotateNEsToCoNLL2003(kaf);
    } else if (outputFormat.equalsIgnoreCase("conll02")) {
      kafToString = annotator.annotateNEsToCoNLL2002(kaf);
    } else {
      newLp.setEndTimestamp();
      kafToString = kaf.toString();
    }
    return kafToString;
  }
537437
static function getAnnotation($name, $class, $method = NULL, $nullable = TRUE)
	{
		try {
			NULL === $method or $annotation = self::getMethodAnnotation($method, $name, $class);
			isset($annotation) or $annotation = self::getClassAnnotation($class, $name);
		} catch (ReflectionException $e) {
			$annotation = NULL;
		}

		return !$nullable && NULL === $annotation
			? self::annotationClass($name)
			: $annotation;
	}
1366652
@Deprecated
  public static <A> A getClassAnnotation(Object object, Class<A> annotationClass) {
    return (A) getAnnotation(object, (Class<? extends Annotation>) annotationClass);
  }
793755
public AnnotationDescr getAnnotation( String name ) {
        return annotations == null ? null : annotations.get( name );
    }
1179477
private <T extends Annotation> T getAnnotation(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> annotationType) {
    try {
      Class<?> clazz = compileClassLoader.loadClass(javaClazz.getFullyQualifiedName());
      Field field = clazz.getField(javaField.getName());
      return field.getAnnotation(annotationType);
    }
    catch (ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException ex) {
      throw new RuntimeException("Unable to get contanst value of field '" + javaClazz.getName() + "#" + javaField.getName() + ":\n" + ex.getMessage(), ex);
    }
  }
763745
private Remote getRemoteAnnotation(Annotated annotated) {
      Remote remote = annotated.getAnnotation(Remote.class);

      if (remote == null) {
         remote = getMetaAnnotation(annotated, Remote.class);
      }
      return remote;
   }
138844
public static JAnnotationUse getAnnotation(JAnnotatable annotatable, JClass annotationClass) {
		for (JAnnotationUse annotation : annotatable.annotations()) {
			if (annotation.getAnnotationClass().equals(annotationClass)) {
				return annotation;
			}
		}

		return null;
	}
1299690
public ModelAnnotation getAnnotation(Class<? extends Annotation> value) {
		for (ModelAnnotation item : annotations) {
			if (item.getName().equals(value.getCanonicalName())) {
				return item;
			}
		}

		return null;
	}
624973
def get_annotations(element):
    
    from labels import get_annotation
    annotations = {}
    for label in element.getchildren():
        if get_xsi_type(label) == 'saltCore:SAnnotation':
            annotations.update([get_annotation(label)])
    return annotations
1105644
def annotations_class(cls):
    
    assert(isclass(cls))
    # To play it safe we avoid to modify the dict while iterating over it,
    # so we previously cache keys.
    # For this we don't use keys() because of Python 3.
    # Todo: Better use inspect.getmembers here
    keys = [key for key in cls.__dict__]
    for key in keys:
        memb = cls.__dict__[key]
        if _check_as_func(memb):
            annotations_func(memb)
        elif isclass(memb):
            annotations_class(memb)
    return cls
830461
@Override
    public  <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
        return AnnotationUtils.getAnnotation(target, annotationClass);
    }