def VisitFunction(self, f):
    'Merge signatures of a function.\n\n    This groups signatures by arguments and then for each group creates a\n    single signature that joins the return values / exceptions using "or".\n\n    Arguments:\n      f: A pytd.Function instance\n\n    Returns:\n      Function with simplified / combined signatures.\n    '
    groups = self._GroupByArguments(f.signatures)
    new_signatures = []
    for (stripped_signature, ret_exc) in groups.items():
        ret = pytd_utils.JoinTypes(ret_exc.return_types)
        exc = tuple(ret_exc.exceptions)
        new_signatures.append(stripped_signature.Replace(return_type=ret, exceptions=exc))
    return f.Replace(signatures=tuple(new_signatures))
Merge signatures of a function.

This groups signatures by arguments and then for each group creates a
single signature that joins the return values / exceptions using "or".

Arguments:
  f: A pytd.Function instance

Returns:
  Function with simplified / combined signatures.
def VisitFunction(self, f):
    'Merge signatures of a function.\n\n    This groups signatures by arguments and then for each group creates a\n    single signature that joins the return values / exceptions using "or".\n\n    Arguments:\n      f: A pytd.Function instance\n\n    Returns:\n      Function with simplified / combined signatures.\n    '
    groups = self._GroupByArguments(f.signatures)
    new_signatures = []
    for (stripped_signature, ret_exc) in groups.items():
        ret = pytd_utils.JoinTypes(ret_exc.return_types)
        exc = tuple(ret_exc.exceptions)
        new_signatures.append(stripped_signature.Replace(return_type=ret, exceptions=exc))
    return f.Replace(signatures=tuple(new_signatures))