def main(args=None):
<EOL>if args is None:<EOL><INDENT>args = parse_args(sys.argv[<NUM_LIT:1>:])<EOL><DEDENT>if args.verbose > <NUM_LIT:1>:<EOL><INDENT>set_log_debug()<EOL><DEDENT>elif args.verbose == <NUM_LIT:1>:<EOL><INDENT>set_log_info()<EOL><DEDENT>outpath = os.path.abspath(os.path.expanduser(args.out_dir))<EOL>cachepath = os.path.abspath(os.path.expanduser(args.cache_dir))<EOL>cache = DiskDataCache(cache_path=cachepath)<EOL>if args.user:<EOL><INDENT>args.PROJECT = _pypi_get_projects_for_user(args.user)<EOL><DEDENT>if args.query:<EOL><INDENT>DataQuery(args.project_id, args.PROJECT, cache).run_queries(<EOL>backfill_num_days=args.backfill_days)<EOL><DEDENT>else:<EOL><INDENT>logger.warning('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if not args.generate:<EOL><INDENT>logger.warning('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>raise SystemExit(<NUM_LIT:0>)<EOL><DEDENT>for proj in args.PROJECT:<EOL><INDENT>logger.info('<STR_LIT>', proj)<EOL>stats = ProjectStats(proj, cache)<EOL>outdir = os.path.join(outpath, proj)<EOL>OutputGenerator(proj, stats, outdir).generate()<EOL><DEDENT>
Main entry point