Restores annotations at arrays which might have been lost due to serialization.

@param {object} mAnnotations - The annotation map

@protected
@see AnnotationParser.backupAnnotationAtArray
@see AnnotationParser.syncAnnotationsAtArrays
@static
181461
function (mAnnotations) {
		if (mAnnotations.annotationsAtArrays) {
			mAnnotations.annotationsAtArrays.forEach(function (aSegments) {
				AnnotationParser.syncAnnotationsAtArrays(mAnnotations, aSegments);
			});
		}
	}
582771
private Map<Integer, List<Annotation>> splitListAnnotations()
  {
    List<Annotation> metadata = Helper.getMetaData(toplevelCorpusName,
      documentName);

    Map<Integer, List<Annotation>> hashMetaData = new HashMap<>();


    if (metadata != null && !metadata.isEmpty())
    {
      // if called from corpus browser sort the other way around.
      if (documentName != null)
      {
        hashMetaData =
          new TreeMap<>(Collections.reverseOrder());
      }
      else
      {
        hashMetaData = new TreeMap<>();
      }

      for (Annotation metaDatum : metadata)
      {
        int pre = metaDatum.getPre();
        if (!hashMetaData.containsKey(pre))
        {
          hashMetaData.put(pre, new ArrayList<Annotation>());
          hashMetaData.get(pre).add(metaDatum);
        }
        else
        {
          hashMetaData.get(pre).add(metaDatum);
        }
      }
    }

    return hashMetaData;
  }
1000329
private void populateAnnotations(Collection<Annotation> annotations) {
        for (Annotation each : annotations) {
            this.annotations.put(each.annotationType(), each);
        }
    }
782893
@Override
    public void synchronizeHostData(INDArray array) {
        if (array.isEmpty() || array.isS())
            return;

        val buffer = array.data().originalDataBuffer() == null ? array.data() : array.data().originalDataBuffer();
        synchronizeHostData(buffer);
    }
634497
def _ConvertAnnotations(self, annotations):
      
      flags = 0
      if annotations:
         for annotation in annotations:
            flags |= self._mapFlags.get(annotation.name, 0)
      return flags
702065
function(sName, mAnnotations, mTarget) {
		// Everything in here must be on Term level, so we overwrite the target with the data from the source

		if (Array.isArray(mAnnotations[sName])) {
			// This is a collection - make sure it stays one
			mTarget[sName] = mAnnotations[sName].slice(0);
		} else {
			// Make sure the map exists in the target
			mTarget[sName] = mTarget[sName] || {};

			for (var sKey in mAnnotations[sName]) {
				mTarget[sName][sKey] = mAnnotations[sName][sKey];
			}
		}
	}
95738
private <T extends ProgramElementDoc> void mapAnnotations(Map<String,List<T>> map, Object doc,
            T holder) {
        AnnotationDesc[] annotations;
        boolean isPackage = false;
        if (doc instanceof ProgramElementDoc) {
            annotations = ((ProgramElementDoc) doc).annotations();
        } else if (doc instanceof PackageDoc) {
            annotations = ((PackageDoc) doc).annotations();
            isPackage = true;
        } else if (doc instanceof Parameter) {
            annotations = ((Parameter) doc).annotations();
        } else {
            throw new DocletAbortException("should not happen");
        }
        for (AnnotationDesc annotation : annotations) {
            AnnotationTypeDoc annotationDoc = annotation.annotationType();
            if (isPackage)
                refList(map, annotationDoc).add(holder);
            else
                add(map, annotationDoc, holder);
        }
    }
325906
function(aMetadata, aAnnotation, oUI5ODataModelAnnotatableObject) {

			for (var i = -1, oAnnotation; (oAnnotation = aAnnotation[++i]) !== undefined;) {
				for (var j = -1, oMetadata; (oMetadata = aMetadata[++j]) !== undefined;) {

					if (!(oAnnotation[oUI5ODataModelAnnotatableObject.keyPropName] == oMetadata[oUI5ODataModelAnnotatableObject.keyPropName])) {
						continue;
					}
					// found match: apply extensions from oAnnotation object to
					// oMetadata object
					if (oAnnotation["extensions"] != undefined) {
						if (oMetadata["extensions"] == undefined) {
							oMetadata["extensions"] = [];
						}

						for (var l = -1, oAnnotationExtension; (oAnnotationExtension = oAnnotation["extensions"][++l]) !== undefined;) {
							var bFound = false;
							for (var m = -1, oMetadataExtension; (oMetadataExtension = oMetadata["extensions"][++m]) !== undefined;) {
								if (oAnnotationExtension.name == oMetadataExtension.name
										&& oAnnotationExtension.namespace == oMetadataExtension.namespace) {
									oMetadataExtension.value = oAnnotationExtension.value;
									bFound = true;
									break;
								}
							}
							if (!bFound) {
								oMetadata["extensions"].push(oAnnotationExtension);
							}
						}
					}
					// walk down to sub objects
					for (var k = -1, oUI5ODataModelAnnotatableSubObject; (oUI5ODataModelAnnotatableSubObject = oUI5ODataModelAnnotatableObject.aSubObject[++k]) !== undefined;) {

						for ( var propName in oAnnotation) {
							if (!(oUI5ODataModelAnnotatableSubObject.objectName == propName)) {
								continue;
							}
							if (!(oAnnotation[oUI5ODataModelAnnotatableSubObject.objectName] instanceof Array)) {
								continue;
							}
							if ((oMetadata[oUI5ODataModelAnnotatableSubObject.objectName] == undefined)
									|| (!(oMetadata[oUI5ODataModelAnnotatableSubObject.objectName] instanceof Array))) {
								continue;
							}
							this.mergeV2AnnotationLevel(oMetadata[oUI5ODataModelAnnotatableSubObject.objectName],
									oAnnotation[oUI5ODataModelAnnotatableSubObject.objectName], oUI5ODataModelAnnotatableSubObject);
							break;
						}
					}
				}
			}
			return;
		}
753404
function createAnnotation(desc) {
  utils.check(['type', 'hasTarget', 'annotatedBy'], desc);

  var anno = { type: desc.type, hasTarget: desc.hasTarget, annotatedAt : desc.annotatedAt || new Date().toISOString(), annotatedBy : desc.annotatedBy, state: desc.state || utils.states.annotations.unvalidated};

 // used to create a hierarchical position
 // FIXME reconcile roots / position
  var position = desc.roots || [], flattened = desc.type + unitSep;
  anno.roots = desc.roots || [];
  if (desc.type === 'quote') {
    utils.check(['ranges', 'quote'], desc);
    if (!desc.ranges || desc.ranges.length < 1) {
      utils.checkError(desc, 'missing ranges');
    }
    anno.quote = desc.quote;
    anno.ranges = desc.ranges;
    position.push(anno.quote);
    flattened += position.join(unitSep);
  } else if (desc.type === 'category') {
    utils.check(['category'], desc);
    anno.category = Array.isArray(desc.category) ? desc.category : [desc.category];
    position = position.concat(anno.category);
    flattened += position.join(unitSep);
  } else if (desc.type === 'value' || desc.type === 'valueQuote') {
    utils.check(['key', 'value'], desc);
    if (desc.type === 'valueQuote') {
      utils.check(['ranges'], desc);
      anno.ranges = desc.ranges;
    }
    anno.key = desc.key;
    anno.value = desc.value;
    position.push(desc.key);
    flattened += position.join(unitSep) + unitSep + desc.value;

// add data types
    if (desc.isA) {
      try {
        anno.isA = desc.isA;
        anno.typed = {};
        anno.typed[desc.isA] = dataTypes[desc.isA](desc.value);
      } catch (e) {
        anno.typed.failure = e;
        GLOBAL.warn('isA failed', e, desc);
      }
    }
  } else {
    throw new Error('unknown type ' + desc.type);
  }
  anno.position = position;
  anno.flattened = flattened;
  if (anno.attributes) {
    anno.attributes = desc.attributes; // additional attributes
  }
  return anno;
}
937550
public static void writeJsonToFile(String filename,
      List<SemanticParserExampleLoss> losses, List<Map<String, Object>> annotations) {
    Preconditions.checkArgument(annotations.size() == losses.size());
    List<String> lines = Lists.newArrayList();
    for (int i = 0; i < losses.size(); i++) {
      lines.add(losses.get(i).toJson(annotations.get(i)));
    }
    IoUtils.writeLines(filename, lines);
  }
237611
void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) {
        if (annotationInfo != null) {
            annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(),
                    RelType.METHOD_ANNOTATIONS, RelType.CLASSES_WITH_METHOD_ANNOTATION);
        }
        if (parameterAnnotationInfo != null) {
            for (int i = 0; i < parameterAnnotationInfo.length; i++) {
                final AnnotationInfo[] pai = parameterAnnotationInfo[i];
                if (pai != null && pai.length > 0) {
                    boolean hasRepeatableAnnotation = false;
                    for (final AnnotationInfo ai : pai) {
                        if (allRepeatableAnnotationNames.contains(ai.getName())) {
                            hasRepeatableAnnotation = true;
                            break;
                        }
                    }
                    if (hasRepeatableAnnotation) {
                        final AnnotationInfoList aiList = new AnnotationInfoList(pai.length);
                        for (final AnnotationInfo ai : pai) {
                            aiList.add(ai);
                        }
                        // There is currently no RelType.CLASSES_WITH_METHOD_PARAMETER_ANNOTATION, so set
                        // RelType values to null
                        aiList.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(), null,
                                null);
                        parameterAnnotationInfo[i] = aiList.toArray(new AnnotationInfo[0]);
                    }
                }
            }
        }
    }
585489
void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) {
        if (annotationInfo != null) {
            annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, this,
                    RelType.CLASS_ANNOTATIONS, RelType.CLASSES_WITH_ANNOTATION);
        }
        if (fieldInfo != null) {
            for (final FieldInfo fi : fieldInfo) {
                fi.handleRepeatableAnnotations(allRepeatableAnnotationNames);
            }
        }
        if (methodInfo != null) {
            for (final MethodInfo mi : methodInfo) {
                mi.handleRepeatableAnnotations(allRepeatableAnnotationNames);
            }
        }
    }
731635
static ImmutableList<String> annotationStrings(List<? extends AnnotationMirror> annotations) {
    // TODO(b/68008628): use ImmutableList.toImmutableList() when that works.
    return ImmutableList.copyOf(
        annotations.stream().map(AnnotationOutput::sourceFormForAnnotation).collect(toList()));
  }
433124
public static final void convertAnnotations(Tree config, Annotation[] annotations)
			throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		for (Annotation annotation : annotations) {

			// Create entry for annotation
			String annotationName = annotation.toString();
			int i = annotationName.lastIndexOf('.');
			if (i > -1) {
				annotationName = annotationName.substring(i + 1);
			}
			i = annotationName.indexOf('(');
			if (i > -1) {
				annotationName = annotationName.substring(0, i);
			}
			if (annotationName.length() > 1) {
				annotationName = Character.toLowerCase(annotationName.charAt(0)) + annotationName.substring(1);
			} else {
				annotationName = annotationName.toLowerCase();
			}
			if ("name".equals(annotationName) || "override".equals(annotationName)) {
				continue;
			}
			Tree annotationMap = config.putMap(annotationName);

			// Add annotation values
			Class<? extends Annotation> type = annotation.annotationType();
			Method[] members = type.getDeclaredMethods();
			for (Method member : members) {
				member.setAccessible(true);
				String propName = member.getName();
				Object propValue = member.invoke(annotation);
				annotationMap.putObject(propName, propValue);
				Tree newChild = annotationMap.get(propName);
				if (newChild.size() < 1) {
					newChild.remove();
				}
			}
			int size = annotationMap.size();
			if (size == 0) {
				annotationMap.remove();
			} else if (size == 1) {
				Tree value = annotationMap.getFirstChild();
				if (value != null && "value".equals(value.getName())) {
					annotationMap.setObject(value.asObject());
				}
			}
		}
	}
436407
function save(namespaces) {
  try {
    if (null == namespaces) {
      exports.storage.removeItem('debug');
    } else {
      exports.storage.debug = namespaces;
    }
  } catch(e) {}
}
605301
function(annotation) {
			if (!annotation) { return; }
			var annotations = this._annotations;
			var index = binarySearch(annotations, annotation.start);
			annotations.splice(index, 0, annotation);
			annotation._annotationModel = this;
			var e = {
				type: "Changed", //$NON-NLS-0$
				added: [annotation],
				removed: [],
				changed: []
			};
			this.onChanged(e);
		}
690888
function() {
			if (!this._treeModel.getAnnotations) {
				return;
			}

			if (this._annotationRefreshRequested) {
				return;
			}

			// Refresh annotation in next tick to avoid duplicate requests
			var tree = this;
			this._annotationRefreshRequested = true;
			setTimeout(function() {
				tree._annotationRefreshRequested = false;
				tree._redrawAnnotation();
			}, 0);
		}