qyliang/CodeNanoFix huggingface dataset:
Buggy code:
while 1:a,b=map(int,input().split())
    if a==b==0:break
    for i in range(a):print('#'*b)
    print()


Fixed code:
while 1:
    a, b = map(int, input().split())
    if a == b == 0:break
    for i in range(a):print('#' * b)
    print()
Buggy code:
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        for i in range(H):
            print(W*"#")
    print("")


Fixed code:
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    for i in range(H):
            print(W*"#")
    print("")
Buggy code:
import sys
x=y=1
while True:
	x,y=map(int,input().split())
	if x==0: break
	for i in range (1,x+1):
		for j in range (1,y+1):
			sys.stdout.write('#')
		print('')
	

Fixed code:
import sys
x=y=1
while True:
	x,y=map(int,input().split())
	if x==0: break
	for i in range (1,x+1):
		for j in range (1,y+1):
			sys.stdout.write('#')
		print('')
	print('')
Buggy code:
while True:
    h, w = map(int, input().split())
    if(w == h == 0): break
    for i in range(h):
        for j in range(w):
            print('#', end = '')
        print('')
        



Fixed code:
while True:
    h, w = input().split()
    if h == "0" and w == "0":
        break
    h = int(h)
    w = int(w)
    for i in range(h):
        for j in range(w):
            print("#", end="")
        print()
    print()
Buggy code:
while(True): 
        h,w = [int(i) for i in input().split()]
        if h == 0 and w == 0:
                break
        for i in range(h):
                out = ''
                for j in range(w):
                        out += '#'
                print(out)

Fixed code:
while(True): 
        h,w = [int(i) for i in input().split()]
        if h == 0 and w == 0:
                break
        for i in range(h):
                out = ''
                for j in range(w):
                        out += '#'
                print(out)
        print('')
Buggy code:
while True:
    H,W = [int(i) for i in input().split()
    if H == W ==0:
        break
    for h in range(h):
        for w in range(w):
            print('#', end='')

        print()

    print()

Fixed code:
while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break
         
    for h in range(H):
        for w in range (W):
            print('#', end='')
         
        print()
     
    print()
Buggy code:
for i in range(100000):
    x = input().split(" ")
    h = int(x[0])
    w = int(x[1])
    if h + w == 0:
        break
    for j in range(h):
        for k in range(w):
            print("#", end = "")
        print("")

        

Fixed code:
for i in range(100000):
    x = input().split(" ")
    h = int(x[0])
    w = int(x[1])
    if h + w == 0:
        break
    for j in range(h):
        for k in range(w):
            print("#", end = "")
        print("")
    print("")
Buggy code:
while True:
    a, b = map(int, input().split())
    if a == 0 and b ==0:
        break
    for j in range(a):
        for i in range(b):
            print("#", end="")
        print()


Fixed code:
while True:
    i,j=map(int,input().split())
    if i==0 and j==0:
        break
    for a in range(0,i):
        for b in range(0,j):
            print("#",sep="",end="")
        print()
    print()
Buggy code:
while True:
    h,w = map(int,input().split())
    if h==0 and w==0:
        break
    else:
        for i in range(h):
            for j in range(w):
                print('#')
        print('')


Fixed code:
while True:
    h,w = map(int,input().split())
    if h==0 and w==0:
        break
    else:
        for i in range(h):
            print('#'*w)
        print('')
Buggy code:
while True:
    H,W = map(int, input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        print (("#" * W ))
        print ()

Fixed code:
while True :
    H, W = map(int, input().split())
    if H == W == 0 :
        break
    for i in range(H) :
        print('#' * W)
    print('')
Buggy code:
while True:
    w,h = map(int,input().split())
    if w == 0 and h == 0:
        break
    for j in range(h):
        for i in range(w):
            print('#', end='')
        print()
    print()

Fixed code:


while True:
    h, w = map(int,input().split())
    if h == 0 and w == 0:
        break
    else:
        for i in range(h):
            for j in range(w):
                print('#', end="")
            print()
        print()
Buggy code:
H = []
W = []
i = 0
while True:
  h, w = map(int, input().split())
  H.append(h)
  W.append(w)
  if H[i] == 0 and W[i] == 0:
    break
  i += 1

i = 0
while True:
  if H[i] == 0 and W[i] == 0:
    break
  for j in range(H[i]):
    for k in range(W[i]):
      print("#", end="")
    print()
  i += 1

Fixed code:
H = []
W = []
i = 0
while True:
  h, w = map(int, input().split())
  H.append(h)
  W.append(w)
  if H[i] == 0 and W[i] == 0:
    break
  i += 1

i = 0
while True:
  if H[i] == 0 and W[i] == 0:
    break
  for j in range(H[i]):
    for k in range(W[i]):
      print("#", end="")
    print()
  print()
  i += 1
Buggy code:
while True:
	try:
		h,w = map(int,input().split(" "))
		if h == 0 and w == 0:
			break
		for i in range(h):
			for j in range(w):
				print("#",end="")
			print()
	except:
		break

Fixed code:
while True:
	try:
		h,w = map(int,input().split(" "))
		if h == 0 and w == 0:
			break
		for i in range(h):
			for j in range(w):
				print("#",end="")
			print()
		print()
	except:
		break
Buggy code:

while True:
	H,W = map(int,input().split())
	if H ==0 and W == 0:
		break
	
	for i in range (H):
		for j in range (W):
			print('#', end="")
		print("")

Fixed code:

while True:
	H,W = map(int,input().split())
	if H ==0 and W == 0:
		break
	
	for i in range (H):
		for j in range (W):
			print('#', end="")
		print("")
	print("")
Buggy code:
buffer = []
while True:
    x,y = map(int, input().split())
    if x==0 and y==0:
        break
    buffer.append([x,y])
for n in range(len(buffer)):
    for r in range(buffer[n][0]):
        print('')
        for c in range(buffer[n][1]):
            print('#', end = '')


Fixed code:
buffer = []
while True:
    x,y = map(int, input().split())
    if x==0 and y==0:
        break
    buffer.append([x,y])
for n in range(len(buffer)):
    for r in range(buffer[n][0]):
        for c in range(buffer[n][1]):
            print('#', end = '')
        print('')
    print('')
Buggy code:
while 1:
	if h==0 and w==0:
		break
	h,w = [int(x) for x in input().split()]
	for i in range(h):
		print("#"*w)
	print("")



Fixed code:
while 1:
	h,w = [int(x) for x in input().split()]
	if h==0 and w==0:
		break
	for i in range(h):
		print("#"*w)
	print("")
Buggy code:
while True:
    H,W = map(int,input().split())
    if (H,W) = =0:
        break
    for i in range(H):
        print("#"*W)
    print()


Fixed code:
while True:
    H,W = map(int,input().split())
    if H==W==0:
        break;
    for i in range(H):
        print("#"*W)
    print()
Buggy code:
a=[]
i=0
while 1:
    l=input().split()

    h=int(l[0])
    w=int(l[1])

    if h==0 and w==0:
        break
    else:
        a.append(h)
        a.append(w)
        i=i+2
m=0
while m<i:
    while a[m]>0:
        print(a[m+1]*"#")
        print("")
        a[m]=a[m]-1
    m=m+2



Fixed code:
a=[]
i=0
while 1:
    l=input().split()

    h=int(l[0])
    w=int(l[1])

    if h==0 and w==0:
        break
    else:
        a.append(h)
        a.append(w)
        i=i+2
m=0
while m<i:
    while a[m]>0:
        print(a[m+1]*"#")
        a[m]=a[m]-1
    print("")
    m=m+2
Buggy code:
while True:
    square = ""
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    for y in range(W):
        square = "#" + square
    for x in range(H):
        print(square)
        



Fixed code:
while True:
    square = ""
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    for y in range(W):
        square = "#" + square
    for x in range(H):
        print(square)
    print()
Buggy code:
while(True) :
    H,W=map(int,input().split())
    if H==0 and W==0 : break
    for i in range(H) :
        for j in range(W) :
            print("#",end="")
        print("")


Fixed code:
W,H=map(int,input().split())
while True:
    for i in range(W):
        for i in range(H):
            print('#',end='')
        print()
    print()
    W,H=map(int,input().split())
    if W==0 and H==0:
        break
Buggy code:
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print('#' * w)

Fixed code:
while True:
    h,w = map(int,input().split())
    
    if h == 0 and w == 0:
        break
    for i in range(h):
        print('#'*w)
        
    print()
Buggy code:
while True:
    m, n = list(map(int, input().split()))
    if m == n == 0:
        break
    for i in range(m):
        print ("#" * n)
    print ("\n")
    



Fixed code:
while True:
    m, n = list(map(int, input().split()))
    if m == n == 0:
        break
    for i in range(m):
        print ("#" * n)
    print ("")
Buggy code:
while True:
    H,W=map(int,input().split())
    if H==0 and W==0: break
    for i in range(H):
        print("#"*W)

Fixed code:
while True:
    H,W=map(int,input().split())
    
    if H==0 and W==0:
        quit()
    
    for i in range(H):
        print("#"*W)
    
    print()
Buggy code:
while 1:
    h,w=map(int,input().split())
    if h==w==0:
        break
    for i in range(h):
        for j in range(w):
            print("#",end="")
        print()

Fixed code:
while 1:
    h,w=map(int,input().split())
    if h==w==0:
        break
    for i in range(h):
        for j in range(w):
            print("#",end="")
        print()
    print()
Buggy code:
while 1:
    k=input().split()
    H=int(k[0])
    W=int(k[1])
    if H==0 and W==0:
        break
    for i in range(H):
        msg=""
        for j in range(W):
            msg +="#"
        print(msg)


Fixed code:
while 1:
    k=input().split()
    H=int(k[0])
    W=int(k[1])
    if H==0 and W==0:
        break
    for i in range(H):
        msg=""
        for j in range(W):
            msg +="#"
        print(msg)
    print("")
Buggy code:
flag=0
while flag==0:
    a,b=[int(i) for i in input().split()]
    if a==0 and b==0:
        flag=1
        break
    else:
        for i in range(a):
            print("#"*b)

Fixed code:

flag=0
while flag==0:
    a,b=[int(i) for i in input().split()]
    if a==0 and b==0:
        flag=1
        break
    else:
        for i in range(a):
            print("#"*b)
    print("")
Buggy code:
while True:
    a,b = map(int, input().split())
    if a ==0 and b == 0:
        break
    for i in range(a):
        for i in range(b):
            print("#", end = "")
        print()


Fixed code:
while True:
    a,b = map(int,input().split())
    if a ==0 and b==0:
        break
    for i in range(a):
        print('#'*b)
    print('')
Buggy code:
# coding: utf-8
# Here your code !

import fileinput

for line in fileinput.input():
    (hight,width) = map(int,line.split(" "))
    
    if hight == 0 and width == 0:
        break
    
    for a in range(hight):
        for b in range(width):
            print("#", end="")
        print("")
    print(" ")

Fixed code:
# coding: utf-8
# Here your code !

import fileinput

for line in fileinput.input():
    (hight,width) = map(int,line.split(" "))
    
    if hight == 0 and width == 0:
        break
    
    for a in range(hight):
        for b in range(width):
            print("#", end="")
        print("")
    print("")
Buggy code:
while True:
	[H, W] = list(map(int, input().split()))

	if H == 0 and W == 0:
		break

	for i in range(H):
		for j in range(W):
			print("#", end = "")
		print("")

Fixed code:
while True:
	[H, W] = list(map(int, input().split()))

	if H == 0 and W == 0:
		break

	for i in range(H):
		for j in range(W):
			print("#", end = "")
		print("")
	print("")
Buggy code:
import sys

l = []
for i in sys.stdin:
    l.append(i)

for i in range(0,len(l)):
    l[i] = l[i].split()

for i in range(0,len(l)-1):
    for j in range(0,int(l[i][0])):
        print('#'*int(l[i][1]))
    print('\n'*1)


Fixed code:
import sys

l = []
for i in sys.stdin:
    l.append(i)

for i in range(0,len(l)):
    l[i] = l[i].split()

for i in range(0,len(l)-1):
    for j in range(0,int(l[i][0])):
        print('#'*int(l[i][1]))
    print()
Buggy code:
while H!=0 and W!=0:
  H,W = map(int, input().split())

  for i in range(H):
    for j in range(W):
      print('#', end="")
    print()
  print()
  if W==0 and H==0:
    break


Fixed code:
while True:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for j in range(W):
            print('#',end="")
        print('')
    print('')
Buggy code:
Flag = True
data = []
while Flag:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        Flag = False
    else:
      data.append((H, W))
#print(data)

for (H, W) in data:
    for i in range(H):
        print('#' * W)
    #print('\n')


Fixed code:
Flag = True
data = []
while Flag:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        Flag = False
    else:
      data.append((H, W))
#print(data)

for (H, W) in data:
    for i in range(H):
        print('#' * W)
    print('\n', end="")
Buggy code:
while(True):
    (H,W)=[int(s) for s in input().split()]
    if (H,W) == (0,0):
        break
    for j in range(H):
        print("#"*W)

Fixed code:
while(True):
    (H,W)=[int(s) for s in input().split()]
    if (H,W) == (0,0):
        break
    for j in range(H):
        print("#"*W)
    print("")
Buggy code:
while True:
    h, w = map(int, input().strip().split())
    if h == w == 0: break
    print(('#'*w+'\n')*h, end='')

Fixed code:
while True:
    h, w = map(int, input().strip().split())
    if h == w == 0: break
    print(('#'*w+'\n')*h)
Buggy code:
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    for i in range(H):
        for j in range(W):
            print("#",end="")
        print()

Fixed code:
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:break
    for i in range(H):
        for j in range(W):
            print("#",end="")
        print()
    print()
Buggy code:
for i in range(10000):
  x = input().split()
  h = int(x[0])
  w = int(x[1])
  if h ==0 and w == 0:
    break
  for i in range(h):
    for i in range(w):
      print("#",end="")
    print() 


Fixed code:
for i in range(10000):
  x = input().split()
  h = int(x[0])
  w = int(x[1])
  if h ==0 and w == 0:
    break
  for i in range(h):
    for i in range(w):
      print("#",end="")
    print() 
  print()
Buggy code:
while True:
    H,W=[int(x) for x in input().split()]
    if H == 0 and W == 0 : break
    for a in range(H):
        for b in range(W):
        print("#")



Fixed code:
while True:
    H,W=[int(x) for x in input().split()]
    if H == 0 and W == 0 : break
    for a in range(H):
        for b in range(W):
            print("#",end='')
        print('')
    print('')
Buggy code:
while True:
  H, W = map(int, input().split())
  for j in range(H):
    for i in range(W):
      print('#',end='')
    print()

if H == 0 and W == 0 :
  break


Fixed code:
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for j in range(W):
            print('#', end="")
        print('')
    print('')
Buggy code:
while True:
	H,W = map(int,input().split(" "))

	if H == 0 and W == 0:
		break

	for _ in range(W):
		s=""
		for _ in range(H):
			s = s+"#"
		print(s)
	print()




Fixed code:
while True:
	H,W = map(int,input().split(" "))

	if H == 0 and W == 0:
		break

	for i in range(H):
		s=""
		for _ in range(W):
			s = s+"#"
		print(s)
	print()
Buggy code:
while True:
	H,W = map(int,input().split(" "))

	if H == 0 and W == 0:
		break

	[print(*["#" for _ in range(W)]) for _ in range(H)]



Fixed code:
while True:
	H,W = map(int,input().split(" "))

	if H == 0 and W == 0:
		break

	[print(*["#"*W]) for _ in range(H)]
	print()
Buggy code:
while 1:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    x = "#" * W
    for i in range(H):
        print(x)

Fixed code:
while 1:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    x = "#" * W
    for i in range(H):
        print(x)
    print("")
Buggy code:
while True:
    a=[int(x) for x in input().split()]
    if a[0]==a[1]==0:
        break
    else:
        for i in range(a[0]):
            print("#"*a[1])
    print("\n")

Fixed code:
while True:
    a=[int(x) for x in input().split()]
    if a[0]==a[1]==0:
        break
    else:
        for i in range(a[0]):
            print("#"*a[1])
    print("")
Buggy code:
while True:
	H,W=[int(i)for i in input().split()]

	if H==0 and W==0:
		break
	else:
		for i in range (H):
			print("#"*W)

Fixed code:
while True:
    H,W = [int(i) for i in input().split()]
    if H == 0 and W == 0:
        break
    for i in range(H):
        print("#" * W)
    print()
Buggy code:
import sys

class Rect():
    def __init__(self,w,h):
        self.w = w
        self.h = h

    def draw(self):
        for i in range(self.h):
            for j in range(self.w):
                sys.stdout.write("#")
            sys.stdout.write("\n")
        sys.stdout.write("\n")

def main():
    data = []
    while 1:
        n = input().split()
        w = int(n[0])
        h = int(n[1])
        
        if w == 0 and h == 0:
            break
        
        data.append(Rect(w,h))

    for num in data:
        num.draw()

if __name__ == "__main__":
    main()

Fixed code:
import sys

class Rect():
    def __init__(self,w,h):
        self.w = w
        self.h = h

    def draw(self):
        for i in range(self.w):
            for j in range(self.h):
                sys.stdout.write("#")
            sys.stdout.write("\n")
        sys.stdout.write("\n")

def main():
    data = []
    while 1:
        n = input().split()
        w = int(n[0])
        h = int(n[1])

        if w == 0 and h == 0:
            break

        data.append(Rect(w,h))

    for num in data:
        num.draw()

if __name__ == "__main__":
    main()
Buggy code:
while True:
    h,w = input().split()
    h = int(h)
    w = int(w)
    if h == 0 and w == 0:
        break
    for j in range(h):
        out = ""
        for i in range(w):
            out += '#'
        print(out)
    print("\n")


Fixed code:
while True:
    h,w = input().split()
    h = int(h)
    w = int(w)
    if h == 0 and w == 0:
        break
    for j in range(h):
        out = ""
        for i in range(w):
            out += '#'
        print(out)
    print("")
Buggy code:
while True:
    h,w = map(int,raw_input().split())
    if h == 0 and w == 0:
		break

    for i in range(h):
        print'#'*w
        print''

Fixed code:
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print('#'*w)
    print()
Buggy code:
while True:
    (H, W) = [int(i) for i in input().split()]
    if H == W == 0:
        break

    [print('#' * W) for d in range(W)]
    print()

Fixed code:
while True:
    (H, W) = [int(i) for i in input().split()]
    if H == W == 0:
        break

    [print('#' * W) for d in range(H)]
    print()
Buggy code:
while True:
 h,w=map(int,input().split())
 if h==0:break
 for _ in range(h):
  print("".join(['*']*w))
 print('')

Fixed code:
while True:
 h,w=map(int,input().split())
 if h==0:break
 for _ in range(h):print("".join(['#']*w))
 print('')
Buggy code:
from sys import stdin

while True:
    (h, w) = [int(i) for i in stdin.readline().split(' ')]
    if h == 0 and w == 0:
        break;

    for i in range(h):
        for j in range(w):
            print('#', end='')
        print()

Fixed code:
from sys import stdin

while True:
    (h, w) = [int(i) for i in stdin.readline().split(' ')]
    if h == 0 and w == 0:
        break;

    for i in range(h):
        for j in range(w):
            print('#', end='')
        print()

    print()
Buggy code:
H,W= map(int, input().split())

while not (H==0 and W==0):
    print('#'*W)
    for i in range(H-2):
        print('#'+'.'*(W-2)+'#')
    print('#'*W)
    print()        
    


Fixed code:
H,W= map(int, input().split())

while not (H==0 and W==0):
    print('#'*W)
    for i in range(H-2):
        print('#'+'.'*(W-2)+'#')
    print('#'*W)
    print()
    H,W= map(int, input().split())
Buggy code:
while True:
 H,W = map(int,input().split())
 if H==0 and W==0:
   break
 else:
   print('#'*W)
   for s in range(0,H-2):
     print('#'+'.'*(W-2)+'#')
   print("#"*W)     
print("")

Fixed code:
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    print('#' * W)
    for i in range(H - 2):
        print('#' + ('.' * (W - 2)) + '#')
    print('#' * W)
    print()
Buggy code:
h,w=list(map(int,input().split()))
while True:
 if(h,w)==(0,0):
  break
 print("#"*w)
 for i in range(h-2):
   print("#"+"."*(w-2)+"#")
 print("#"*w)
 break

Fixed code:
while True:
    h, w = map(int, input().split())
    if h == w == 0:
        break

    print('#' * w)
    for i in range(h - 2):
        print('#' + '.' * (w - 2) + '#')
    print('#' * w)
    print()
Buggy code:
H = []
W = []
i = 0
while True:
  h, w = map(int, input().split())
  H.append(h)
  W.append(w)
  if H[i] == 0 and W[i] == 0:
    break
  i += 1

i = 0
while True:
  if H[i] == 0 and W[i] == 0:
    break
  for k in range(W[i]):
    print("#", end="")
  print()
  for j in range(H[i] - 2):
    print("#")
    for k in range(W[i] - 2):
      print(".", end = "")
    print("#")
  for k in range(W[i]):
    print("#", end = "")
  print()
  print()
  i += 1

Fixed code:
H = []
W = []
i = 0
while True:
  h, w = map(int, input().split())
  H.append(h)
  W.append(w)
  if H[i] == 0 and W[i] == 0:
    break
  i += 1

i = 0
while True:
  if H[i] == 0 and W[i] == 0:
    break
  for k in range(W[i]):
    print("#", end = "")
  print()
  for j in range(H[i] - 2):
    print("#", end = "")
    for k in range(W[i] - 2):
      print(".", end = "")
    print("#")
  for k in range(W[i]):
    print("#", end = "")
  print()
  print()
  i += 1
Buggy code:
while True:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w))
 for _ in range(h-2):print('#'+'.'*(w-2)+'#'))
 print(('#'*w))
 print()

Fixed code:
while True:
    h, w = map(int, input().split())
    if h == 0: break
    print("#" * w)
    for i in range(h - 2):
        print("#" + "." * (w - 2) + "#")
    print("#" * w)    
    print()
Buggy code:
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    else:
        for i in range(H):
            for j in range(W):
                if j == W - 1:
                    print("#")
                elif i != 0 and i != H - 1 and j != 0 and j != W - 1:
                    print("*", end="")
                else:
                    print("#", end="")
        print()



Fixed code:
while True:
  H,W = map(int, input().split())
  if H == 0 and W == 0:
    break
  print('#' * W)
  for i in range(1, H-1):
    print('#', end='')
    for j in range(1, W-1):
      print('.', end='')
    print('#')
  print('#' * W)
  print()
Buggy code:
for i in range(10000):
  x = input().split()
  h = int(x[0])
  w = int(x[1])
  if h == 0 and w ==0:
    break
  for i in range(w):
    print("#",end="")
  print()  
  for i in range(h-2):
    print("#",end="")
    for i in range(w-2):
      print(".",end="")
    print("#",end="")
    print()
  for i in range(w):
    print("#",end="")
  print()  


Fixed code:
for i in range(10000):
  x = input().split()
  h = int(x[0])
  w = int(x[1])
  if h == 0 and w ==0:
    break
  for i in range(w):
    print("#",end="")
  print()  
  for i in range(h-2):
    print("#",end="")
    for i in range(w-2):
      print(".",end="")
    print("#",end="")
    print()
  for i in range(w):
    print("#",end="")
  print()
  print()