def feature_list_and_dict(features):
    """
    Assign numerical indices to a global list of features
    :param features: iterable of feature names
    :return: sorted list of features, dict mapping features to their indices
    """
    feature_list = sorted(features)
    feature_dict = {feat:i for i, feat in enumerate(feature_list)}
    return feature_list, feature_dict