def do_stacks(self,args):
parser = CommandArgumentParser()<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',dest='<STR_LIT>',action='<STR_LIT:store_true>',help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',nargs='<STR_LIT:*>',dest='<STR_LIT>',default=[],help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>','<STR_LIT>',nargs='<STR_LIT:*>',dest='<STR_LIT>',default=[],help='<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>',dest='<STR_LIT>',action='<STR_LIT:store_true>',default=False,help='<STR_LIT>')<EOL>parser.add_argument(dest='<STR_LIT>',nargs='<STR_LIT:*>',default=["<STR_LIT:*>"],help='<STR_LIT>')<EOL>args = vars(parser.parse_args(args))<EOL>nextToken = None<EOL>includes = args['<STR_LIT>']<EOL>excludes = args['<STR_LIT>']<EOL>filters = args['<STR_LIT>']<EOL>global stackStatusFilter<EOL>for i in includes:            <EOL><INDENT>if not i in stackStatusFilter:<EOL><INDENT>stackStatusFilter.append(i)<EOL><DEDENT><DEDENT>for e in excludes:<EOL><INDENT>stackStatusFilter.remove(e)<EOL><DEDENT>complete = False;<EOL>stackSummaries = []<EOL>while not complete:<EOL><INDENT>if None == nextToken:<EOL><INDENT>stacks = AwsConnectionFactory.getCfClient().list_stacks(StackStatusFilter=stackStatusFilter)<EOL><DEDENT>else:<EOL><INDENT>stacks = AwsConnectionFactory.getCfClient().list_stacks(NextToken=nextToken,StackStatusFilter=stackStatusFilter)<EOL><DEDENT>if not '<STR_LIT>' in stacks:<EOL><INDENT>complete = True;<EOL><DEDENT>else:<EOL><INDENT>nextToken = stacks['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in stacks:<EOL><INDENT>stackSummaries.extend(stacks['<STR_LIT>'])<EOL><DEDENT><DEDENT>stackSummaries = [x for x in stackSummaries if fnmatches(x['<STR_LIT>'],filters)]<EOL>stackSummaries = sorted(stackSummaries, key= lambda entry: entry['<STR_LIT>'])<EOL>index = <NUM_LIT:0>;<EOL>stackSummariesByIndex = {}<EOL>for summary in stackSummaries:<EOL><INDENT>summary['<STR_LIT>'] = index<EOL>stackSummariesByIndex[index] = summary<EOL>index += <NUM_LIT:1><EOL><DEDENT>self.stackList = stackSummariesByIndex<EOL>if not (args['<STR_LIT>'] or args['<STR_LIT>']):<EOL><INDENT>for index,summary in list(stackSummariesByIndex.items()):<EOL><INDENT>print('<STR_LIT>'.format(summary['<STR_LIT>'],summary['<STR_LIT>'],summary['<STR_LIT>'],defaultifyDict(summary,'<STR_LIT>','<STR_LIT>')))<EOL><DEDENT><DEDENT>if args['<STR_LIT>'] and not args['<STR_LIT>']:<EOL><INDENT>print('<STR_LIT>'.format(len(stackSummariesByIndex)))<EOL><DEDENT>
List available stacks. stacks -h for detailed help.