Buggy python submission (verdict: Time Limit Exceeded):
import re

H, W = map(int, input().split())
S_list = [input() for _ in range(H)]

l_wall = [[i.span()[0] for i in re.finditer('#', '#'+s+'#')] for s in S_list]
r_wall = [[i.span()[0] for i in re.finditer('#', '#'+''.join(s)+'#')] for s in list(zip(*S_list))]

l_light = sum([[i[j+1]-i[j]-1 for j in range(len(i)-1)] if len(i) != 1 else i for i in l_wall], [])
r_light = sum([[i[j+1]-i[j]-1 for j in range(len(i)-1)] if len(i) != 1 else i for i in r_wall], [])

ans = max([l+r-1 for l in l_light for r in r_light])

print(ans)

Fixed submission:
import numpy as np

H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]
S_list=(np.array(S_list) ==".")*1

L = np.zeros((H, W), int)
R = np.zeros((H, W), int)
U = np.zeros((H, W), int)
D = np.zeros((H, W), int)

for w in range(W):
    if w == 0:
        L[:,w] = S_list[:,w]
        R[:,W-w-1] = S_list[:,W-w-1]
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w]
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1]

for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
        
ans = max(np.max(L+R+U+D-3), 0)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import re

H, W = map(int, input().split())
S_list = [input() for _ in range(H)]

l_count = [[i.span()[0] for i in re.finditer('#', s+'#')] for s in S_list]

r_count = [[i.span()[0] for i in re.finditer('#', ''.join(s)+'#')] for s in list(zip(*S_list))]

ans = 0
    
for h in range(H):
    for w in range(W):
        if S_list[h][w] == '.':
            l_light = 0
            r_light = 0
            for l in l_count[h]:
                if(w < l):
                    l_light = l - l_light
                    break
                l_light = l+1
            for r in r_count[w]:
                if(h < r):
                    r_light = r - r_light
                    break
                r_light = r+1
            
            ans = max(ans, l_light+r_light-1)

print(ans)

Fixed submission:
import numpy as np

H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]
S_list=(np.array(S_list) ==".")*1

L = np.zeros((H, W), int)
R = np.zeros((H, W), int)
U = np.zeros((H, W), int)
D = np.zeros((H, W), int)

for w in range(W):
    if w == 0:
        L[:,w] = S_list[:,w]
        R[:,W-w-1] = S_list[:,W-w-1]
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w]
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1]

for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
        
ans = max(np.max(L+R+U+D-3), 0)

print(ans)

Buggy python submission (verdict: Runtime Error):
import re

H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]

l_count = [[i.span()[0] for i in re.finditer('#', s+'#')] for s in S_list]

r_count = [[i.span()[0] for i in re.finditer('#', ''.join(s)+'#')] for s in list(zip(*S_list))]

ans = 0
    
for h in range(H):
    for w in range(W):
        if line[h][w] == '.':
            l_light = 0
            r_light = 0
            for l in l_count[h]:
                if(w < l):
                    l_light = l - l_light
                    break
                l_light = l+1
            for r in r_count[w]:
                if(h < r):
                    r_light = r - r_light
                    break
                r_light = r+1
            
            ans = max(ans, l_light+r_light-1)

print(ans)

Fixed submission:
import numpy as np

H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]
S_list=(np.array(S_list) ==".")*1

L = np.zeros((H, W), int)
R = np.zeros((H, W), int)
U = np.zeros((H, W), int)
D = np.zeros((H, W), int)

for w in range(W):
    if w == 0:
        L[:,w] = S_list[:,w]
        R[:,W-w-1] = S_list[:,W-w-1]
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w]
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1]

for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
        
ans = max(np.max(L+R+U+D-3), 0)

print(ans)