<commit_before>// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:collection';

import 'package:angular_components/model/ui/has_renderer.dart';

/// Sorts a list of items using the ItemRenderer to obtain a string
/// representation.
List<String> sortItems(ItemRenderer itemRenderer, Iterable entities,
    {bool ignoreCase: false}) {
  if (ignoreCase) {
    return new SplayTreeMap<dynamic, String>.fromIterable(entities,
        key: (Object c) => itemRenderer(c).toLowerCase()).values.toList();
  }
  return new SplayTreeMap<dynamic, String>.fromIterable(entities,
      key: (Object c) => itemRenderer(c)).values.toList();
}<commit_msg>Fix columns to be ordered alphabetically by columnGroup first, then by display name.<commit_after>// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:collection';

import 'package:angular_components/model/ui/has_renderer.dart';

/// Returns a new list of items sorted according to the string obtained from
/// [itemRenderer].
///
/// [itemRenderer] should return a unique string representation for each item.
List<T> sortItems<T>(ItemRenderer<T> itemRenderer, Iterable<T> items,
    {bool ignoreCase: false}) {
  if (ignoreCase) {
    return new SplayTreeMap<String, T>.fromIterable(items,
        key: (T item) => itemRenderer(item).toLowerCase()).values.toList();
  }
  return new SplayTreeMap<String, T>.fromIterable(items,
      key: (T item) => itemRenderer(item)).values.toList();
}
{'fraction_non_alphanumeric': 0.11378923766816143, 'fraction_numerical': 0.004484304932735426, 'mean_word_length': 4.344311377245509, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7294060', 'n_tokens_mistral': 512, 'n_tokens_neox': 508, 'n_words': 183}