def _get_data_list(data, key):
    """get key's value as list from request arg dict.

    If the value type is list, return it, otherwise return the list
    whos only element is the value got from the dict.

    Example: data = {'a': ['b'], 'b': 5, 'c': ['d', 'e'], 'd': []}
             _get_data_list(data, 'a') == ['b']
             _get_data_list(data, 'b') == [5]
             _get_data_list(data, 'd') == []
             _get_data_list(data, 'e') == []

    Usage: Used to parse the key-value pair in request.args to expected types.
           Depends on the different flask plugins and what kind of parameters
           passed in, the request.args format may be as below:
           {'a': 'b'} or {'a': ['b']}. _get_data_list forces translate the
           request.args to the format {'a': ['b']}. It accepts the case that
           some parameter declares multiple times.
    """
    if key in data:
        if isinstance(data[key], list):
            return data[key]
        else:
            return [data[key]]
    else:
        return []