def expand_fc_groups(users):
groups = None<EOL>for user in users:<EOL><INDENT>fcgroup = None<EOL>if '<STR_LIT:@>' not in user:<EOL><INDENT>fcgroup = user<EOL><DEDENT>elif user.lower().endswith('<STR_LIT>'):<EOL><INDENT>if groups is None:<EOL><INDENT>r = fapi.get_groups()<EOL>fapi._check_response_code(r, <NUM_LIT:200>)<EOL>groups = {group['<STR_LIT>'].lower():group['<STR_LIT>']for group in r.json() if group['<STR_LIT>'] == '<STR_LIT>'}<EOL><DEDENT>if user.lower() not in groups:<EOL><INDENT>if fcconfig.verbosity:<EOL><INDENT>eprint("<STR_LIT>".format(user))<EOL><DEDENT>yield user<EOL>continue<EOL><DEDENT>else:<EOL><INDENT>fcgroup = groups[user.lower()]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>yield user<EOL>continue<EOL><DEDENT>r = fapi.get_group(fcgroup)<EOL>fapi._check_response_code(r, <NUM_LIT:200>)<EOL>fcgroup_data = r.json()<EOL>for admin in fcgroup_data['<STR_LIT>']:<EOL><INDENT>yield admin<EOL><DEDENT>for member in fcgroup_data['<STR_LIT>']:<EOL><INDENT>yield member<EOL><DEDENT><DEDENT>
If user is a firecloud group, return all members of the group.
    Caveat is that only group admins may do this.