<s> from django . core . management . base import LabelCommand <EOL> from dimagi . utils . couch . database import get_db <EOL> from corehq . apps . hqadmin . history import download_changes <EOL> class Command ( LabelCommand ) : <EOL> help = "<STR_LIT>" <EOL> args = "<STR_LIT>" <EOL> label = "<STR_LIT>" <EOL> def handle ( self , * args , ** options ) : <EOL> limit = int ( args [ <NUM_LIT:0> ] ) if args else <NUM_LIT> <EOL> file = args [ <NUM_LIT:1> ] if len ( args ) > <NUM_LIT:1> else '<STR_LIT>' <EOL> with open ( file , '<STR_LIT:wb>' ) as f : <EOL> download_changes ( get_db ( ) , limit , f ) </s>
