Buggy python submission (verdict: Time Limit Exceeded):
import sys, math, fractions, itertools, collections


def solve(N: int, s: "List[str]"):
    S = []
    for ss in s:
        ss = sorted(ss)
        S.append(''.join(ss))
    c = collections.Counter(S).values()
    s = 0
    for cc in c:
        s += len(list(itertools.combinations(range(cc), 2)))
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, s)

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, s: "List[str]"):
    S = []
    for ss in s:
        ss = sorted(ss)
        S.append(''.join(ss))
    c = list(collections.Counter(S).values())
    s = 0
    for cc in c:
        s += cc*(cc-1)//2
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, s)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, s: "List[str]"):
    S = []
    for ss in s:
        ss = sorted(ss)
        S.append(''.join(ss))
    c = collections.Counter(S).values()
    s = 0
    for cc in c:
        s += len(list(itertools.combinations(range(cc), 2)))
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, s)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, s: "List[str]"):
    S = []
    for ss in s:
        ss = sorted(ss)
        S.append(''.join(ss))
    c = list(collections.Counter(S).values())
    s = 0
    for cc in c:
        s += cc*(cc-1)//2
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, s)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, s: "List[str]"):
    S = []
    for ss in s:
        ss = sorted(ss)
        S.append(''.join(ss))
    c = collections.Counter(S).values()
    s = 0
    for cc in c:
        s += len(list(itertools.combinations(range(cc), 2)))
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, s)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, s: "List[str]"):
    S = []
    for ss in s:
        ss = sorted(ss)
        S.append(''.join(ss))
    c = list(collections.Counter(S).values())
    s = 0
    for cc in c:
        s += cc*(cc-1)//2
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, s)

if __name__ == '__main__':
    main()