<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize(data, b64_encode=True, uri_encode=True):
 """Serializes a python dictionary into a Gzip, Base64 encoded string :param data: Python dictionary or list to serialize :param b64_encode: If True, the message will be compressed using Gzip and encoded using Base64 :param uri_encode: If True, the message will be encoded with the urllib.parse.quote_plus to be used as a value of a URI parameter :return: Serialized data string, encoded if `encode` is `True` 'H4sIANRnb1oC/6tWSkxPVbJSMDbUUVDKS8wFsZW88jPylID8xOTk/NK8EqBQtVJmCpAyNDIHChelpmfm5xUD+dFKocEghcHuSrG1tQCN2YKETAAAAA==' 'H4sIAOdnb1oC%2F6tWSkxPVbJSMDbUUVDKS8wFsZW88jPylID8xOTk%2FNK8EqBQtVJmCpAyNDIHChelpmfm5xUD%2BdFKocEghcHuSrG1tQCN2YKETAAAAA%3D%3D' = """


    if not isinstance(data, dict):
        raise RuntimeError("Only dictionaries are supported. The following is not a dictionary:\n %s", data)

    message = json.dumps(data)

    if b64_encode:
        message = jsonuri.io.compress(message).decode('utf-8')

    if uri_encode:
        message = urllib.parse.quote_plus(message)

    return message