<s> """<STR_LIT>""" <EOL> import logging , time <EOL> from django . core . management . base import BaseCommand <EOL> from ... charge import ( recognize_income , extend_subscriptions , <EOL> create_charges_for_balance , complete_charges ) <EOL> from ... utils import datetime_or_now <EOL> LOGGER = logging . getLogger ( __name__ ) <EOL> class Command ( BaseCommand ) : <EOL> help = """<STR_LIT>""" <EOL> def add_arguments ( self , parser ) : <EOL> parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store_true>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store_true>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , <EOL> dest = '<STR_LIT>' , default = None , <EOL> help = '<STR_LIT>' ) <EOL> def handle ( self , * args , ** options ) : <EOL> dry_run = options [ '<STR_LIT>' ] <EOL> no_charges = options [ '<STR_LIT>' ] <EOL> end_period = datetime_or_now ( options [ '<STR_LIT>' ] ) <EOL> if dry_run : <EOL> LOGGER . warning ( "<STR_LIT>" ) <EOL> if no_charges : <EOL> LOGGER . warning ( "<STR_LIT>" ) <EOL> recognize_income ( end_period , dry_run = dry_run ) <EOL> extend_subscriptions ( end_period , dry_run = dry_run ) <EOL> create_charges_for_balance ( end_period , dry_run = dry_run or no_charges ) <EOL> if not ( dry_run or no_charges ) : <EOL> time . sleep ( <NUM_LIT:30> ) <EOL> complete_charges ( ) </s>
