def parse_name(source, allow_numeric=False, allow_group_0=False):
 name = source.get_while(set(')>'), include=False)
 if (not name):
  raise error('missing group name', source.string, source.pos)
 if name.isdigit():
  min_group = (0 if allow_group_0 else 1)
  if ((not allow_numeric) or (int(name) < min_group)):
   raise error('bad character in group name', source.string, source.pos)
 elif (not is_identifier(name)):
  raise error('bad character in group name', source.string, source.pos)
 return name

def parse_name ( source , allow_numeric = False , allow_group_0 = False ) : name = source . get_while ( set ( ')>' ) , include = False ) if ( not name ) : raise error ( 'missing group name' , source . string , source . pos ) if name . isdigit ( ) : min_group = ( 0 if allow_group_0 else 1 ) if ( ( not allow_numeric ) or ( int ( name ) < min_group ) ) : raise error ( 'bad character in group name' , source . string , source . pos ) elif ( not is_identifier ( name ) ) : raise error ( 'bad character in group name' , source . string , source . pos ) return name
parses a name .