def record_has(inrec, fieldvals):
 retval = False
 for field in fieldvals:
  if isinstance(inrec[field], str):
   set1 = {inrec[field]}
  else:
   set1 = set(inrec[field])
  if (set1 & fieldvals[field]):
   retval = True
   break
 return retval

def record_has ( inrec , fieldvals ) : retval = False for field in fieldvals : if isinstance ( inrec [ field ] , str ) : set1 = { inrec [ field ] } else : set1 = set ( inrec [ field ] ) if ( set1 & fieldvals [ field ] ) : retval = True break return retval
accepts a record .