def _check_firstset(info, reverse, fs):
 if ((not fs) or (None in fs)):
  return None
 members = set()
 case_flags = NOCASE
 for i in fs:
  if (isinstance(i, Character) and (not i.positive)):
   return None
  case_flags |= i.case_flags
  members.add(i.with_flags(case_flags=NOCASE))
 if (case_flags == (FULLCASE | IGNORECASE)):
  return None
 fs = SetUnion(info, list(members), case_flags=(case_flags & (~ FULLCASE)), zerowidth=True)
 fs = fs.optimise(info, reverse, in_set=True)
 return fs

def _check_firstset ( info , reverse , fs ) : if ( ( not fs ) or ( None in fs ) ) : return None members = set ( ) case_flags = NOCASE for i in fs : if ( isinstance ( i , Character ) and ( not i . positive ) ) : return None case_flags |= i . case_flags members . add ( i . with_flags ( case_flags = NOCASE ) ) if ( case_flags == ( FULLCASE | IGNORECASE ) ) : return None fs = SetUnion ( info , list ( members ) , case_flags = ( case_flags & ( ~ FULLCASE ) ) , zerowidth = True ) fs = fs . optimise ( info , reverse , in_set = True ) return fs
checks the firstset for the pattern .