Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from scipy.sparse.csgraph import connected_components
import collections
 
N, M = map(int, input().split())
ab = []
for i in range(M):
    ab.append(list(map(int,input().split())))
 
l = [[0 for _ in range(N)] for _ in range(N)]
 
for i in range(M):
    l[ab[i][0]-1][ab[i][1]-1] = 1
 
a = np.array(l)
n, labels = connected_components(a)
 
print(collections.Counter(labels).most_common()[0][1])

Fixed submission:
from collections import defaultdict
from collections import deque

d = defaultdict(set) #初期中身は空のset

N, M = map(int, input().split())
for i in range(M):
  A, B = map(int, input().split())
  d[A-1].add(B-1)
  d[B-1].add(A-1)
        
check = [0]*N
mans = 0

for i in range(N):
    ans = 0
    if check[i] == 0:
        check[i] = 1
        ans += 1
        sl = deque(list(d[i]))
        while sl:
            s = sl.pop()
            if check[s] == 0:
                check[s] = 1
                ans += 1
                sl.extend(list(d[s]))
    if mans < ans:
        mans = ans

print(mans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import connected_components
import collections

def main():
    N, M = map(int, input().split())
    ab = []
    for i in range(M):
        ab.append(list(map(int,input().split())))

    l = np.zeros((N, N), dtype = np.int64)

    for i in range(M):
        l[ab[i][0]-1,ab[i][1]-1] = 1
        #[ab[i][1]-1][ab[i][0]-1] = 1

    a = np.array(l)
    n, labels = connected_components(a)

    print(collections.Counter(labels).most_common()[0][1])
    
if __name__ == "__main__":
    main()

Fixed submission:
from collections import defaultdict
from collections import deque

d = defaultdict(set) #初期中身は空のset

N, M = map(int, input().split())
for i in range(M):
  A, B = map(int, input().split())
  d[A-1].add(B-1)
  d[B-1].add(A-1)
        
check = [0]*N
mans = 0

for i in range(N):
    ans = 0
    if check[i] == 0:
        check[i] = 1
        ans += 1
        sl = deque(list(d[i]))
        while sl:
            s = sl.pop()
            if check[s] == 0:
                check[s] = 1
                ans += 1
                sl.extend(list(d[s]))
    if mans < ans:
        mans = ans

print(mans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from scipy.sparse.csgraph import connected_components
import collections

N, M = map(int, input().split())
ab = []
for i in range(M):
    ab.append(list(map(int,input().split())))

l = [[0 for _ in range(N)] for _ in range(N)]

for i in range(M):
    l[ab[i][0]-1][ab[i][1]-1] = 1
    l[ab[i][1]-1][ab[i][0]-1] = 1

a = np.array(l)
n, labels = connected_components(a)

print(collections.Counter(labels).most_common()[0][1])

Fixed submission:
from collections import defaultdict
from collections import deque

d = defaultdict(set) #初期中身は空のset

N, M = map(int, input().split())
for i in range(M):
  A, B = map(int, input().split())
  d[A-1].add(B-1)
  d[B-1].add(A-1)
        
check = [0]*N
mans = 0

for i in range(N):
    ans = 0
    if check[i] == 0:
        check[i] = 1
        ans += 1
        sl = deque(list(d[i]))
        while sl:
            s = sl.pop()
            if check[s] == 0:
                check[s] = 1
                ans += 1
                sl.extend(list(d[s]))
    if mans < ans:
        mans = ans

print(mans)