parameters: (parameters)
return_statement: return tuple(params)
docstring: An internal helper for Union creation and substitution: flatten Unions
      among parameters, then remove duplicates.
docstring_summary: An internal helper for Union creation and substitution: flatten Unions
      among parameters, then remove duplicates.
docstring_tokens: An internal helper for Union creation and substitution : flatten Unions among parameters then remove duplicates .
function: 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, _GenericAlias) and p.__origin__ is Union:
              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)
      # Weed out strict duplicates, preserving the first of each occurrence.
      all_params = set(params)
      if len(all_params) < len(params):
          new_params = []
          for t in params:
              if t in all_params:
                  new_params.append(t)
                  all_params.remove(t)
          params = new_params
          assert not all_params, all_params
      return tuple(params)
function_tokens: def _remove_dups_flatten ( parameters ) : # Flatten out Union[Union[...], ...]. params = [ ] for p in parameters : if isinstance ( p , _GenericAlias ) and p . __origin__ is Union : 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 ) # Weed out strict duplicates, preserving the first of each occurrence. all_params = set ( params ) if len ( all_params ) < len ( params ) : new_params = [ ] for t in params : if t in all_params : new_params . append ( t ) all_params . remove ( t ) params = new_params assert not all_params , all_params return tuple ( params )