Module Expr Str Import alias ImportFrom alias Import alias alias alias alias Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Assign NameStore Str For NameStore Call AttributeLoad NameLoad attr Str body AugAssignAdd NameStore BinOpAdd NameLoad Str TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Pass Return NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Pass Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd BinOpAdd Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse Pass Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Num body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad For NameStore SubscriptLoad NameLoad Slice Num NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Print Call AttributeLoad Str attr NameLoad orelse If UnaryOpNot NameLoad body Print Call AttributeLoad Str attr NameLoad Assign NameStore NameLoad Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Dict Str Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareGt BinOpSub Call AttributeLoad NameLoad attr NameLoad Num body Print Call AttributeLoad Str attr BinOpSub Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Str If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Print NameLoad orelse If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr orelse Print NameLoad
N/A N/A 
    a class to download NAIP imagery from 
    the s3://aws-naip RequesterPays bucket
 N/A boto3 random shuffle N/A sys os subprocess time N/A GEO_DATA_DIR N/A N/A N/A os environ get GEO_DATA_DIR N/A NAIP_DATA_DIR N/A N/A N/A os path join GEO_DATA_DIR naip NAIPDownloader N/A N/A __init__ N/A N/A self number_of_naips should_randomize state year resolution spectrum grid hardcoded_naip_list N/A None N/A N/A 
        download some arbitrary NAIP images from the aws-naip S3 bucket
     N/A N/A self number_of_naips number_of_naips N/A N/A self should_randomize should_randomize N/A N/A self hardcoded_naip_list hardcoded_naip_list N/A N/A self state state N/A N/A self year year N/A N/A self resolution resolution N/A N/A self spectrum spectrum N/A N/A self grid grid N/A N/A self bucket_url s3://aws-naip/ N/A N/A self url_base N/A N/A {}{}/{}/{}/{}/{}/ format N/A self bucket_url N/A self state N/A self year N/A self resolution N/A self spectrum N/A self grid N/A N/A N/A self make_directory NAIP_DATA_DIR full_path True N/A make_directory N/A N/A self new_dir full_path N/A False N/A N/A 
       make a new directory tree if it doesn't already exist
     N/A full_path N/A N/A path N/A token N/A N/A new_dir split / N/A N/A path N/A token / N/A N/A N/A N/A N/A os mkdir path N/A N/A N/A N/A N/A path N/A N/A N/A N/A N/A os mkdir new_dir N/A N/A N/A N/A N/A new_dir N/A download_naips N/A N/A self N/A N/A N/A 
        download self.number_of_naips randomish NAIPs from aws-naip bucket
     N/A N/A N/A self configure_s3cmd N/A naip_filenames N/A self hardcoded_naip_list N/A N/A naip_filenames N/A N/A naip_filenames N/A N/A self list_naips N/A N/A self should_randomize N/A N/A N/A shuffle naip_filenames N/A naip_local_paths N/A N/A self download_from_s3 naip_filenames N/A naip_local_paths N/A configure_s3cmd N/A N/A self N/A N/A N/A  
        configure s3cmd with AWS credentials
     N/A file_path N/A N/A / N/A N/A N/A os environ get HOME /.s3cfg N/A f N/A open file_path r N/A filedata N/A N/A f read N/A N/A N/A f close N/A newdata N/A N/A filedata replace AWS_ACCESS_KEY N/A N/A N/A os environ get AWS_ACCESS_KEY_ID N/A newdata N/A N/A newdata replace AWS_SECRET_KEY N/A N/A N/A os environ get AWS_SECRET_ACCESS_KEY N/A f N/A open file_path w N/A N/A N/A f write newdata N/A N/A N/A f close N/A list_naips N/A N/A self N/A N/A N/A 
        make a list of NAIPs based on the init parameters for the class
     N/A bash_command N/A N/A s3cmd ls --recursive --skip-existing {} --requester-pays format N/A self url_base N/A process N/A N/A subprocess Popen N/A N/A bash_command split stdout N/A subprocess PIPE N/A output N/A N/A N/A process communicate N/A 0 N/A naip_filenames N/A N/A line N/A N/A output split N/A N/A parts N/A N/A line split N/A self url_base N/A N/A N/A len parts 2 N/A N/A N/A N/A naip_filenames append N/A parts N/A 1 N/A N/A N/A naip_filenames N/A download_from_s3 N/A N/A self naip_filenames N/A N/A N/A 
        download the NAIPs and return a list of the file paths
     N/A s3_client N/A N/A boto3 client s3 N/A naip_local_paths N/A N/A max_range N/A self number_of_naips N/A N/A max_range -1 N/A N/A max_range N/A len naip_filenames N/A t0 N/A N/A time time N/A has_printed False N/A filename N/A naip_filenames N/A 0 max_range N/A N/A full_path N/A N/A N/A os path join NAIP_DATA_DIR filename N/A N/A N/A N/A os path exists full_path N/A N/A N/A N/A NAIP {} already downloaded format full_path N/A N/A N/A has_printed N/A N/A N/A N/A DOWNLOADING {} NAIPs... format max_range N/A has_printed True N/A url_without_prefix N/A N/A N/A N/A self url_base split N/A self bucket_url N/A 1 N/A s3_url N/A N/A {}{} format url_without_prefix filename N/A N/A N/A s3_client download_file aws-naip s3_url full_path N/A RequestPayer requester N/A N/A N/A naip_local_paths append full_path N/A N/A N/A N/A N/A time time t0 0.01 N/A N/A N/A N/A downloads took {0:.1f}s format N/A N/A N/A time time t0 N/A naip_local_paths N/A N/A N/A N/A __name__ __main__ N/A N/A parameters_message parameters are: download N/A N/A N/A len N/A sys argv 1 N/A N/A parameters_message N/A N/A N/A N/A N/A sys argv N/A 1 download N/A N/A naiper N/A NAIPDownloader N/A N/A N/A naiper download_naips N/A N/A parameters_message