@staticmethod
def filter_by(array, key, value=None):
    if value:
        grouped = Exchange.group_by(array, key)
        if (value in grouped):
            return grouped[value]
        return []
    return array
@staticmethod
def filter_by(array, key, value=None):
    if value:
        grouped = Exchange.group_by(array, key)
        if (value in grouped):
            return grouped[value]
        return []
    return array