uniqueList = [] def isDuplicate(inValue): if inValue in uniqueList: return 1 else: uniqueList.append(inValue) return 0
I suggest using a cursor instead:
from collections import Counter
layer = # name of layer or path to feature class
with arcpy.da.UpdateCursor(layer, ["NAME", "Field"]) as cur:
count = Counter(name for name, field in cur)
cur.reset()
for name, field in cur:
cur.updateRow([name, 1 if count(name) > 1 else 0])