Filter, store, and sort attributes from the given map.
164055
private List<DColumn> loadAttributes(Map<String, AttributeValue> attributeMap,
                                         Predicate<String> colNamePredicate) {
        List<DColumn> columns = new ArrayList<>();
        if (attributeMap != null) {
            for (Map.Entry<String, AttributeValue> mapEntry : attributeMap.entrySet()) {
                String colName = mapEntry.getKey();
                if (!colName.equals(DynamoDBService.ROW_KEY_ATTR_NAME) && // Don't add row key attribute as a column
                                colNamePredicate.test(colName)) {
                    AttributeValue attrValue = mapEntry.getValue();
                    if (attrValue.getB() != null) {
                        columns.add(new DColumn(colName, Utils.getBytes(attrValue.getB())));
                    } else if (attrValue.getS() != null) {
                        String value = attrValue.getS();
                        if (value.equals(DynamoDBService.NULL_COLUMN_MARKER)) {
                            value = "";
                        }
                        columns.add(new DColumn(colName, value));
                    } else {
                        throw new RuntimeException("Unknown AttributeValue type: " + attrValue);
                    }
                }
            }
        }
        
        // Sort or reverse sort column names.
        Collections.sort(columns, new Comparator<DColumn>() {
            @Override public int compare(DColumn col1, DColumn col2) {
                return col1.getName().compareTo(col2.getName());
            }
        });
        return columns;
    }
1108040
public static <K, V> Map<K, V> toSortedMap(Map<K, V> map, Comparator<? super K> comparator) {
        Map<K, V> sortedMap;
        if (comparator == null)
            sortedMap = new LinkedHashMap<>();
        else
            sortedMap = new TreeMap<>(comparator);
        sortedMap.putAll(map);
        return sortedMap;
    }
1299242
function normalizeMap (map) {
  return Array.isArray(map)
    ? map.map(key => ({ key, val: key }))
    : Object.keys(map).map(key => ({ key, val: map[key] }))
}
451500
protected void sortIndexMap() {
        for (Iterator<List<Doc>> it = indexmap.values().iterator(); it.hasNext(); ) {
            Collections.sort(it.next(), new DocComparator());
        }
    }
1294357
public static SortedSet<String> sortedKeys(Map<String, String> map) {
        return new TreeSet<String>(map.keySet());
    }
785941
private static <K, V> ImmutableMap<K, V> filterMapToKeysPreservingOrder(
      final ImmutableMap<? extends K, ? extends V> map, Iterable<? extends K> keys) {
    final ImmutableMap.Builder<K, V> ret = ImmutableMap.builder();
    for (final K key : keys) {
      final V value = map.get(key);
      checkArgument(value != null, "Key " + key + " not in map");
      ret.put(key, value);
    }
    return ret.build();
  }
378044
def _create_request_map(cls, input_map):
        """"""
        field_map = cls._get_attributes_map()
        return {field_map[k]: v for k, v in input_map.items() if k in field_map}
1101436
protected void fromFlatMap(Map<String, String> map) {

    for (Entry<String, String> entry : map.entrySet()) {
      SimpleConfigProperties child;
      child = (SimpleConfigProperties) getChild(entry.getKey(), true);
      child.value = entry.getValue();
    }
  }
1132234
private Attr[] sortAttributes(NamedNodeMap attrs) {

        int len = (attrs != null) ? attrs.getLength() : 0;
        Attr[] array = new Attr[len];
        for (int i = 0; i < len; i++) {
            array[i] = (Attr) attrs.item(i);
        }
        for (int i = 0; i < len - 1; i++) {
            String name = array[i].getNodeName();
            int index = i;
            for (int j = i + 1; j < len; j++) {
                String curName = array[j].getNodeName();
                if (curName.compareTo(name) < 0) {
                    name = curName;
                    index = j;
                }
            }
            if (index != i) {
                Attr temp = array[i];
                array[i] = array[index];
                array[index] = temp;
            }
        }
        return (array);
    }
1228911
private int attributeMap(String name) {
        Integer num = map.get(name);
        if (num == null) {
            return 0;
        }
        return num.intValue();
    }
1230053
def matchRecordAttrs(mapobj, attrs):
    """"""
    for k,v in iteritems(attrs):
        try:    val = getattr(mapobj, k)
        except AttributeError:       # k isn't an attr of record
            if bool(v): return False # if k doesn't exist in mapobj but was required, no match
            else:       continue     # otherwise ignore attributes that aren't defined for the given map record
        if val != v:    return False # if any criteria matches, it's considered a match
    return True
314540
public static Map<String, String> criterionToFilters(Criterion criterion, MapModel mapModel) {
		if (criterion != null) {
			if (criterion instanceof AttributeCriterion) {
				return attributeCriterionToFilters((AttributeCriterion) criterion);

			} else if (criterion instanceof GeometryCriterion) {
				return geometryCriterionToFilters((GeometryCriterion) criterion, mapModel);

			} else if (criterion instanceof AndCriterion) {
				return andCriterionToFilters((AndCriterion) criterion, mapModel);

			} else if (criterion instanceof OrCriterion) {
				return orCriterionToFilters((OrCriterion) criterion, mapModel);

			} else {
				return null;
			}
		} else {
			return new LinkedHashMap<String, String>();
		}
	}
466146
public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(
            Map<K, V> map) {
        return sortByValue(map, false);
    }
617075
public static <V> Map<String, V> cleanupMap(Map<String, V> map) {
        if (map == null || map.isEmpty()) {
            return null;
        }

        Map<String, V> result = new HashMap<String, V>(map.size());
        Set<Entry<String, V>> entries = map.entrySet();

        for (Entry<String, V> entry : entries) {
            if (entry.getValue() != null) {
                result.put(entry.getKey(), entry.getValue());
            }
        }

        return result;
    }
547505
public static <K, V> Map<K, V> filter(Map<K, V> map, Editor<Entry<K, V>> editor) {
		return MapUtil.filter(map, editor);
	}
1063423
public static <K, V> Map<K, V> newFilteredMap(Map<K, V> map,
            Predicate<? super Entry<K, V>> filter) {
        return getEntryStreamWithFilter(map, filter)
                .collect(toMap(Entry::getKey, Entry::getValue));
    }
577140
function filterAttributes (name, attributes) {
  const filtered = {}

  if (attributes.href) {
    filtered.href = attributes.href
  }

  return filtered
}