@staticmethod
def group_by(array, key):
    result = {}
    array = Exchange.to_array(array)
    array = [entry for entry in array if ((key in entry) and (entry[key] is not None))]
    for entry in array:
        if (entry[key] not in result):
            result[entry[key]] = []
        result[entry[key]].append(entry)
    return result
@staticmethod
def group_by(array, key):
    result = {}
    array = Exchange.to_array(array)
    array = [entry for entry in array if ((key in entry) and (entry[key] is not None))]
    for entry in array:
        if (entry[key] not in result):
            result[entry[key]] = []
        result[entry[key]].append(entry)
    return result