def collapse_if_tuple(abi):
typ = abi["<STR_LIT:type>"]<EOL>if not typ.startswith("<STR_LIT>"):<EOL><INDENT>return typ<EOL><DEDENT>delimited = "<STR_LIT:U+002C>".join(collapse_if_tuple(c) for c in abi["<STR_LIT>"])<EOL>array_dim = typ[<NUM_LIT:5>:]<EOL>collapsed = "<STR_LIT>".format(delimited, array_dim)<EOL>return collapsed<EOL>
Converts a tuple from a dict to a parenthesized list of its types.

    >>> from eth_utils.abi import collapse_if_tuple
    >>> collapse_if_tuple(
    ...     {
    ...         'components': [
    ...             {'name': 'anAddress', 'type': 'address'},
    ...             {'name': 'anInt', 'type': 'uint256'},
    ...             {'name': 'someBytes', 'type': 'bytes'},
    ...         ],
    ...         'type': 'tuple',
    ...     }
    ... )
    '(address,uint256,bytes)'