(parameters)
return tuple(_deduplicate(params))
An internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
An internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
An internal helper for Union creation and substitution : flatten Unions among parameters then remove duplicates .
def _remove_dups_flatten(parameters):
    """An internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    """
    # Flatten out Union[Union[...], ...].
    params = []
    for p in parameters:
        if isinstance(p, (_UnionGenericAlias, types.UnionType)):
            params.extend(p.__args__)
        elif isinstance(p, tuple) and len(p) > 0 and p[0] is Union:
            params.extend(p[1:])
        else:
            params.append(p)

    return tuple(_deduplicate(params))
def _remove_dups_flatten ( parameters ) : # Flatten out Union[Union[...], ...]. params = [ ] for p in parameters : if isinstance ( p , ( _UnionGenericAlias , types . UnionType ) ) : params . extend ( p . __args__ ) elif isinstance ( p , tuple ) and len ( p ) > 0 and p [ 0 ] is Union : params . extend ( p [ 1 : ] ) else : params . append ( p ) return tuple ( _deduplicate ( params ) )