qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# -*- coding: utf-8 -*-
bigALlist = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
smoALlist = list('abcdefghijklmnopqrstuvwxyz')
cnt = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
while True:
    try:
        text = list(input())
        for j in range(len(bigALlist)):
            for i in text:
                if (bigALlist[j] in i) or (smoALlist[j] in i):
                    cnt[j] = cnt[j] + 1
            print('{0} : {1}'.format(smoALlist[j],cnt))
    except EOFError:
        break


Fixed code:
# -*- coding: utf-8 -*-
bigALlist = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
smoALlist = list('abcdefghijklmnopqrstuvwxyz')
cnt = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
while True:
    try:
        text = list(input())
        for j in range(len(bigALlist)):
            for i in text:
                if (bigALlist[j] in i) or (smoALlist[j] in i):
                    cnt[j] = cnt[j] + 1
    except EOFError:
        break
for j in range(len(bigALlist)):
    print('{0} : {1}'.format(smoALlist[j],cnt[j]))
Buggy code:
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
C = []
a = input()
a = a.lower()
for i in range(len(alpha)):
    k = a.count(alpha[i])
    C.append(k)
for i in range(len(alpha)):
    print(alpha[i]+" : ",C[i])


Fixed code:
import sys
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
C = []
b = ""
for line in sys.stdin:
    a = line.lower()
    b += a
for i in range(len(alpha)):
    k = b.count(alpha[i])
    C.append(k)
for i in range(len(alpha)):
    print(alpha[i]+" :",C[i])
Buggy code:
import sys

sentence = sys.stdin.read().lower()
alf=[chr(i) for i in range(ord('a'), ord('z')+1)]

ans=dict(zip(alf, [0]*26))

for a in sentence:
  if a in ans:
    ans[a] += 1

for (key, val) in sorted(ans.items()):
  print(key ," : " , val)

Fixed code:
import sys

sentence = sys.stdin.read().lower()
alf=[chr(i) for i in range(ord('a'), ord('z')+1)]

ans=dict(zip(alf, [0]*26))

for a in sentence:
  if a in ans:
    ans[a] += 1

for (key, val) in sorted(ans.items()):
  print(key ,":" , val)
Buggy code:
import sys
 
chash = {}
for i in range( ord( 'a' ), ord( 'z' ) ):
    chash[ chr( i ) ] = 0

lines = sys.stdin.readlines()
for i in range( len( lines ) ):
	for j in range( len( lines[i] ) ):
	    if lines[i][j].isalpha():
	        chash[ lines[i][j].lower() ] += 1
 
for i in range( ord( 'a' ), ord( 'z' ) ):
    print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )	

Fixed code:
import sys
 
chash = {}
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    chash[ chr( i ) ] = 0

lines = sys.stdin.readlines()
for i in range( len( lines ) ):
	for j in range( len( lines[i] ) ):
	    if lines[i][j].isalpha():
	        chash[ lines[i][j].lower() ] += 1
 
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )
Buggy code:
import sys

chash = {}
for i in range( ord( 'a' ), ord( 'z' ) ):
	chash[ chr( i ) ] = 0

for line in sys.stdin:
	for i in range( len( line ) ):
		if line[i].isalpha():
			chash[ line[i].lower() ] += 1

for i in range( ord( 'a' ), ord( 'z' ) ):
	print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )
	

Fixed code:
import sys
 
chash = {}
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    chash[ chr( i ) ] = 0
 
for line in sys.stdin:
    for i in range( len( line ) ):
        if line[i].isalpha():
            chash[ line[i].lower() ] += 1
 
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )
Buggy code:
import sys

chash = {}
for i in range( ord( 'a' ), ord( 'z' ) ):
	chash[ chr( i ) ] = 0

while True:
	line = sys.stdin.readline().rstrip()
	if not line:
		break
	for i in range( len( line ) ):
		if line[i].isalpha():
			chash[ line[i].lower() ] += 1

for i in range( ord( 'a' ), ord( 'z' ) ):
	print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )

Fixed code:
import sys
 
chash = {}
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    chash[ chr( i ) ] = 0
 
while True:
    line = sys.stdin.readline().rstrip()
    if not line:
        break
    for i in range( len( line ) ):
        if line[i].isalpha():
            chash[ line[i].lower() ] += 1
 
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )
Buggy code:
import sys

cnt = {}

for line in sys.stdin:
    for c in line:
        if c.isalpha():
            cl = c.lower
            cnt[cl] = cnt.get(c, 0) + 1

for i in range(97, 97 + 26):
    c = chr(i)
    print("{0} : {1}".format(c, cnt.get(c, 0)))


Fixed code:
import sys

cnt = {}

for line in sys.stdin:
    for c in line:
        if c.isalpha():
            cl = c.lower()
            cnt[cl] = cnt.get(cl, 0) + 1

for i in range(97, 97 + 26):
    c = chr(i)
    print("{0} : {1}".format(c, cnt.get(c, 0)))
Buggy code:
count={}
for i in range(97,97+26):
    count[chr(i)] = 0

text=[]
text_out=""
while True:
    try:
        text.append(input())
    except EOFError:
        text_out="".join(text)

text_lower=text_out.lower()

for letter in text_lower:
    if letter in count:
        count[letter] += 1

for x,y in sorted(count.items()):
    print("{0} : {1}".format(x,y))

Fixed code:
count={}
for i in range(97,97+26):
    count[chr(i)] = 0

text=[]
while True:
    try:
        text.append(input())
    except EOFError:
        break

text_out="".join(text)
text_lower=text_out.lower()

for letter in text_lower:
    if letter in count:
        count[letter] += 1

for x,y in sorted(count.items()):
    print("{0} : {1}".format(x,y))
Buggy code:
import sys
import io
import re
az =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower()
    for i in range(26):
        if x == az[i]:
                sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))
                

Fixed code:
import sys
az =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower():
    for i in range(26):
        if x == az[i]:
            sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))
Buggy code:
s = ""
while True:
    try:
        sent = input()
    except:
        break
    s += sent
    
ch=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r',
 's','t','u','v','w','x', 'y', 'z']

sl=s.lower()

for c in ch:
    cnt=s.count(c)
    print("{} : {}".format(c,cnt))

Fixed code:
s = ""
while True:
    try:
        sent = input()
    except:
        break
    s += sent
    
ch=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r',
 's','t','u','v','w','x', 'y', 'z']

sl=s.lower()

for c in ch:
    cnt=sl.count(c)
    print("{} : {}".format(c,cnt))
Buggy code:
try:
    text = ""
    while True:
        text += input()
except:
    for s in [chr(k) for k in range(97,97+26)]:
        print(s,":",text.count(s))

Fixed code:
try:
    text = ""
    while True:
        text += input()
except:
    for s in [chr(k) for k in range(97,97+26)]:
        print(s,":",text.lower().count(s))
Buggy code:
import sys
import string

count = {k : 0 for k in string.ascii_lowercase}
print(count)
for c in list(sys.stdin.read().lower()):
    if c.islower():
        count[c] = count[c] + 1
for k, v in count.items():
    print(f"{k} : {v}")


Fixed code:
import sys
import string

count = {k : 0 for k in string.ascii_lowercase}
for c in list(sys.stdin.read().lower()):
    if c.islower():
        count[c] = count[c] + 1
for k, v in count.items():
    print(f"{k} : {v}")
Buggy code:
import sys
 
string = str()
 
for line in sys.stdin:
    string += line.lower()

string = input().lower()
alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

for letter in alph:
	sum = 0
	n = -1
	while True:
		n = string.find(letter, n + 1)
		if n == -1:
			break
		sum += 1
	print("{} : {}".format(letter, sum))

Fixed code:
import sys
 
string = str()
 
for line in sys.stdin:
    string += line.lower()

alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

for letter in alph:
	sum = 0
	n = -1
	while True:
		n = string.find(letter, n + 1)
		if n == -1:
			break
		sum += 1
	print("{} : {}".format(letter, sum))
Buggy code:
import sys, string

lines = []
for line in sys.stdin:
    lines.append(line)

text = ''.join(lines).lower()
    
for char in string.ascii_lowercase:
    print("{}:{}".format(char, text.count(char)))

Fixed code:
import sys, string

lines = []
for line in sys.stdin:
    lines.append(line)

text = ''.join(lines).lower()
    
for char in string.ascii_lowercase:
    print("{} : {}".format(char, text.count(char)))
Buggy code:
try:
    a=""
    while True:
        S=input()
        if not S:
            break
        S=S.lower()
        a=a+S
except EOFError:
    pass
for i in range(97,97+26):
    
    b=a.count(chr(i))
    print(chr(i)+": "+str(b))


          

Fixed code:
try:
    a=""
    while True:
        S=input()
        if not S:
            break
        S=S.lower()
        a=a+S
except EOFError:
    pass
for i in range(97,97+26):
    b=a.count(chr(i))
    print(chr(i)+" : "+str(b))
Buggy code:
a=""
while 1:
 try:InputText += input().lower()
 except:break
[print(chr(97+i),':',a.count(chr(97+i)))for i in range(26)]

Fixed code:
a=""
while 1:
 try:a+=input().lower()
 except:break
[print(chr(97+i),':',a.count(chr(97+i)))for i in range(26)]
Buggy code:
def main():

    Counter = 0
    Text_W = input()
    while True:
        Text_T = input().lower()
        if "END_OF_TEXT" in Text_T:
            temp = Text_T.split()
            for i in range(len(temp)):
                Counter += 1 if Text_W == temp[i] else 0
            break
        else:
            temp = Text_T.split()
            for i in range(len(temp)):
                Counter += 1 if Text_W == temp[i] else 0

    print (Counter)

if __name__ == '__main__':
    main()
    


Fixed code:
def main():

    Counter = 0
    Text_W = input()
    while True:
        Text_T = input()
        if "END_OF_TEXT" in Text_T:
            temp = Text_T.lower().split()
            for i in range(len(temp)):
                Counter += 1 if Text_W == temp[i] else 0
            break
        else:
            temp = Text_T.lower().split()
            for i in range(len(temp)):
                Counter += 1 if Text_W == temp[i] else 0

    print (Counter)

if __name__ == '__main__':
    main()
Buggy code:
w = input()
while True:
    s = [1 if i.lower() == w else 'fin' if i == 'END_OF_TEXT' else 0 for i in input().split()]
    if 'fin' in s:
        break
print(s.count(1))


Fixed code:
w = input()
t = []
while True:
    s = [1 if i.lower() == w else 'fin' if i == 'END_OF_TEXT' else 0 for i in input().split()]
    t += s
    if 'fin' in s:
        break
print(t.count(1))
Buggy code:
import sys
s = input().lower()
t = sys.stdin.read().lower().split()
print(t)
print(t.count(s))


Fixed code:
import sys
s = input().lower()
t = sys.stdin.read().lower().split()
print(t.count(s))
Buggy code:
W = str(input()).lower() 

table = []
count = 0

while True:
    
    T = str(input())
    if T == "END_OF_TEXT":
        break
    else:
        T = T.lower()
    
    table.append(T)
    
    
for i in range(len(table)):
    if i == W:
        count += 1
    
print(count)


Fixed code:
W = str(input()).lower() 

table = []
count = 0

while True:
    
    T = str(input())
    if T == "END_OF_TEXT":
        break
    else:
        T = T.lower().split()
    
    for j in range(len(T)):
        table.append(T[j])
    
    
for i in table:
    if i == W:
        count += 1
    
print(count)
Buggy code:
from sys import stdin
import re

W = stdin.readline().rstrip()
T = stdin.read().replace("END_OF_TEXT", ".").lower()
T = re.split(",|\n| ", T)
print(T)
print(len([x for x in T if x == W]))


Fixed code:
from sys import stdin
import re

W = stdin.readline().rstrip()
T = stdin.read().replace("END_OF_TEXT", ".").lower()
T = re.split(",|\n| ", T)
print(len([x for x in T if x == W]))
Buggy code:
w=input()
ll=list()
while True:
    T=input()
    T=T.lower()
    if T=="END_OF_TEXT":
        break
    t=T.split()
    for i in t:
        ll.append(i)
ans=ll.count(w)
print(ans)



Fixed code:
w=input()
ll=list()
while True:
    T=input()
    if T=="END_OF_TEXT":
        break
    T=T.lower()
    t=T.split()
    for i in t:
        ll.append(i)
ans=ll.count(w)
print(ans)
Buggy code:
key_word = input().lower()
counter = 0
while True:
    sentences = input().lower().split()
    if sentences == ['END_OF_TEXT']:
        break
    for sent in sentences:
        if sent == key_word:
            counter += 1
print(counter)



Fixed code:
key_word = input().lower()
counter = 0
while True:
    sentences = input().split()
    if sentences == ['END_OF_TEXT']:
        break
    for sent in sentences:
        if sent.lower() == key_word:
            counter += 1
print(counter)
Buggy code:
a = input()
cnt = 0
while 1:
    c = input().lower()
    if c = 'end_of_text':
        break
    cnt += c.split().count(a)
print(cnt)


Fixed code:
a = input().lower()
cnt = 0
while 1:
    c = input()
    if c == 'END_OF_TEXT':
        break
    cnt += c.lower().split().count(a)
print(cnt)
Buggy code:
W=input()

Ti=[]
count=0

while True:
  T=input()
  s=T.lower()
  if T=="END_OF_TEXT":
    break
  Ti += list(s.split())

  
for i in range(len(Ti)):
  if Ti[i]==W:
    count +=1
print(Ti)
print(count)


Fixed code:
W=input()

Ti=[]
count=0

while True:
  T=input()
  s=T.lower()
  if T=="END_OF_TEXT":
    break
  Ti += list(s.split())

  
for i in range(len(Ti)):
  if Ti[i]==W:
    count +=1

print(count)
Buggy code:
import sys

keyword = input().lowercase()
count = 0
for line in sys.stdin:
    count += sum([1 for word in line.lowercase().split() if word == keyword])
    
print(count)

Fixed code:
import sys

keyword = input().lower()
count = 0
for line in sys.stdin:
    count += sum([1 for word in line.lower().split() if word == keyword])
    
print(count)
Buggy code:
target = input()

count = 0
while True:
    line = input().lower
    if line == 'END_OF_TEXT':
        break

    for word in line.split():
        if word.lower == target.lower:
            count += 1

print(count)

Fixed code:
target = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for word in line.split():
        if word.lower() == target.lower():
            count += 1
print(count)
Buggy code:
#coding:utf-8
#1_9_A 2015.4.10
w = input().lower()
c = 0
while True:
    t = input()
    if 'END_OF_TEXT' in t:
        break
    c += t.lower().split()lower().count(w)
print(c)

Fixed code:
#coding:utf-8
#1_9_A 2015.4.12
w = input().lower()
c = 0
while True:
    t = input()
    if 'END_OF_TEXT' in t:
        break
    c += t.lower().split().count(w)
print(c)
Buggy code:
import sys

w = sys.stdin.readline().rstrip().lower()
cnt = 0
while True:
    lines = sys.stdin.readline().rstrip()
    if not lines:
		break	
    words = lines.split( " " )
    for i in range( len( words ) ):
    	if w == words[i].lower():
			cnt = cnt + 1	

print( cnt )

Fixed code:
import sys

w = sys.stdin.readline().rstrip().lower()
cnt = 0
while True:
	lines = sys.stdin.readline().rstrip()
	if not lines:
		break
	words = lines.split( " " )
	for i in range( len( words ) ):
		if w == words[i].lower():
			cnt = cnt + 1	

print( cnt )
Buggy code:

w = input().casefold()
word_count = 0
while True:
    line = input().casefold()
    if line == "END_OF_TEXT":
        break
    word = line.split()
    word_count += word.count(w)
print(word_count)

Fixed code:

w = input().casefold()
word_count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    word = line.split()
    word_count += word.count(w)
print(word_count)
Buggy code:
W = input()
count = 0
T = input().upper()
#print(T)
while T != 'END_OF_TEXT':
    for i in T.split():
        if i == W:
            count += 1
    T = input().upper()
    #print(T)

print(count)

Fixed code:

W = input()
count = 0
T = input()
#print(T)
while T != 'END_OF_TEXT':
    for i in T.lower().split():
        if W == i:
            count += 1
    T = input()
    #print(i)

print(count)
Buggy code:
import sys

match = input().lower()

s = str()
for line in sys.stdin:
	s += line.lower()
print(s)
print(s.split().count(match))

Fixed code:
import sys

match = input().lower()

s = str()
for line in sys.stdin:
	s += line.lower()
print(s.split().count(match))
Buggy code:
W = input()
 
count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
     
    for s in line.lower().split():
        if s == W:
            count += 1
             
         
     
print(count

Fixed code:
W = input()
 
count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
     
    for s in line.lower().split():
        if s == W:
            count += 1
             
         
     
print(count)
Buggy code:
W = input()
num = 0
for line in input():
    if line == 'END_OF_TEXT':
        break
    for word in line.split():
        if word.lower() == W.lower():
            num += 1
print(num)

Fixed code:
W = input()
num = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    for word in line.split():
        if word.lower() == W.lower():
            num += 1
print(num)
Buggy code:
W = input().lower()
T = ""
while True:
  inp = input().strip()
  if inp == 'END_OF_TEXT':
    break
  T += inp.strip().lower()+' '


print(T.split())

print(T.split().count(W))

Fixed code:
W = input().lower()
T = ""
while True:
  inp = input().strip()
  if inp == 'END_OF_TEXT':
    break
  T += inp.strip().lower()+' '


print(T.split().count(W))
Buggy code:
w=raw_input()
W=w.lower()
Text=[]
while True:
    text=raw_input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))

Fixed code:
w=input()
W=w.lower()
Text=[]
while True:
    text=input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))
Buggy code:
import sys
W = input()
print(sys.stdin.read().rstrip('END_OF_TEXT').lower().split(" ").count())

Fixed code:
import sys
W = input().lower()
print(sys.stdin.read().rstrip('END_OF_TEXT').lower().split().count(W))
Buggy code:
W = input().lower()

T = []
while True:
	R = input()
	print(R)
	if R == "END_OF_TEXT":
		break
	R = R + " "
	T.append(R)

print(T)
T = (''.join(T)).lower()
print(T)
T = T.split()
print(T)
print(T.count(W))

Fixed code:
W = input().lower()

T = []
while True:
	R = input()
	if R == "END_OF_TEXT":
		break
	R = R + " "
	T.append(R)

T = (''.join(T)).lower()
T = T.split()
print(T.count(W))
Buggy code:
cnt = 0
s = input().lower()
while 1:
    line = input()
    if line == "END_OF_TEXT":
        break
    for s in line.lower().split():
print(cnt)

Fixed code:
cnt = 0
s = input().lower()
while 1:
    line = input()
    if line == "END_OF_TEXT":
        break
    for w in line.lower().split():
        if w == s:
            cnt+=1
print(cnt)
Buggy code:
W = input()
#print(W)
t=0

while(1):
	char_list = list(x.lower() for x in input().split())
	#print(char_list)
	if char_list[0] == 'END_OF_TEXT':
		break
	
	for i in range(len(char_list)):
		if W == char_list[i]:
			t += 1

print(t)

Fixed code:
W = input().lower()
#print(W)
t=0

while(1):
	char_list = list(x for x in input().split())
	#print(char_list)
	if char_list[0] == 'END_OF_TEXT':
		break
	
	for i in range(len(char_list)):
		if W == char_list[i].lower():
			t += 1

print(t)
Buggy code:
count = 0
W = input().lower()
T = ""
while True:
    try:
        if T[0] == "END_OF_TEXT":
            break
        for t in T:
            if W == t:
                count += 1 
        T = [x.lower() for x in input().split()]
    except EOFError:
        break
print(count)

Fixed code:
count = 0
W = input().lower()
T = [0]
while True:
    try:
        if T[0] == "END_OF_TEXT":
            break
        for t in T:
            if W == t:
                count += 1
        T = [x.lower() for x in input().split()]
    except EOFError:
        break
    except IndexError:
        break
print(count)
Buggy code:
from collections import Counter
W=input().lower()
count=0
while True:
    line=input().split()
    if line==["END_OF_TEXT"]:
        break
    print(line)
    count+=Counter(map(lambda x:x.lower(),line))[W]
print(count)

Fixed code:
from collections import Counter
W=input().lower()
count=0
while True:
    line=input().split()
    if line==["END_OF_TEXT"]:
        break
    count+=Counter(map(lambda x:x.lower(),line))[W]
print(count)
Buggy code:
W = input()
cnt = 0
s = ""
while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    s += T.lower()
s = list(s.split())
print(s)
for S in s:
    if S == W:
        cnt += 1
print(cnt)

Fixed code:
W = input()
cnt = 0
while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    
    T = list(T.lower().split())
    for S in T:
        if S == W:
            cnt += 1
print(cnt)
Buggy code:
n = 0
T=""
s= input()
while True:
    t=input()
    T += t + " "
    if T.count("END_OF_TEXT")>0:
        break

TL = T.split(" ")
print (TL)
for i in TL:
    if i == str(s):
        n +=1
    else:
        pass
print (n)
        

Fixed code:
n = 0
T=""
s= input().lower()
while True:
    t=input()
    T += t + " "
    if T.count("END_OF_TEXT")>0:
        break

TL = T.split(" ")

for i in TL:
    i = i.replace('"','')
    i= i.replace(".","")
    if i.lower() == str(s):
        n += 1
    else:
        pass
print (n)
Buggy code:
w = input()
t = ""
while 1:
    try:
        t += input().lower()
        t += " "
    except EOFError:
        break
s = t.split()
print(s)
count = 0
for i in s:
    if i == w:
        count += 1
print(count)

Fixed code:
w = input()
t = ""
while 1:
    try:
        t += input().lower()
        t += " "
    except EOFError:
        break
s = t.split()
count = 0
for i in s:
    if i == w:
        count += 1
print(count)
Buggy code:
import re
c=0
p=input().upper()
ptn=re.compile(r'^'+p+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        print(i)
        if re.match(ptn, i):
            c+=1
print(c)

Fixed code:
import re

c=0
p=re.compile(r'^'+input().upper()+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        if re.match(p, i):
            c+=1
print(c)
Buggy code:
word=input().lower()
how_int=0
while True:
    letters=input()
    if letters=='END_OF_TEXT':
        break
    for i in letters.lower().split():
        if i==word:
            how_in+=1
print(how_in)

Fixed code:
word=input().lower()
how_in=0
while True:
    letters=input()
    if letters=='END_OF_TEXT':
        break
    for i in letters.lower().split():
        if i==word:
            how_in+=1
print(how_in)
Buggy code:
word = input().lower()
texts = []
while TRUE:
  str = input()
  if str == 'END_OF_TEXT':
    break
  texts.extend([s.lower() for s in str.split()] )
    

ans = texts.count(word)

print(ans)

Fixed code:
word = input().lower()
texts = []
while True:
  str = input()
  if str == 'END_OF_TEXT':
    break
  texts.extend([s.lower() for s in str.split()] )
    

ans = texts.count(word)

print(ans)
Buggy code:
W=input()
T=[]
while 1:
 a=input()
 if'END_OF_TEXT '==a:break
 T+=[s.lower() for s in a.split()]
print(T.count(W))

Fixed code:
W=input()
T=[]
while 1:
 a=input()
 if'END_OF_TEXT'==a:break
 T+=[s.lower() for s in a.split()]
print(T.count(W))
Buggy code:
st=input()
count=0
while(True):
    s=input()
    if s=="END_OF_TEXT":
        break
    t=s.split()
    for k in t:
        if k.lower()==s:
            count+=1
print(count)

Fixed code:
st=input()
count=0
while(True):
    s=input()
    if s=="END_OF_TEXT":
        break
    t=s.split()
    for k in t:
        if k.lower()==st:
            count+=1
print(count)