original_docstring: 
      Downloads a shapefile from gadm to the data/shapefiles folder
      
      Parameters
      ----------
      countrycode : str
          Three letter ISO 3166-1 alpha-3 country code
          
      level : int
          Administrative level 0-5
          
      force : boolean
          Set to true to force the download and overwrite existing files
          
      verbose : int
          Specify output printing during the process
          
      
docstring: Downloads a shapefile from gadm to the data/shapefiles folder
  Parameters
  
  countrycode : str
  Three letter ISO 3166-1 alpha-3 country code
  
  level : int
  Administrative level 0-5
  
  force : boolean
  Set to true to force the download and overwrite existing files
  
  verbose : int
  Specify output printing during the process
docstring_tokens: Downloads a shapefile from gadm to the data / shapefiles folder Parameters countrycode : str Three letter ISO 3166 - 1 alpha - 3 country code level : int Administrative level 0 - 5 force : boolean Set to true to force the download and overwrite existing files verbose : int Specify output printing during the process
code: def download_shapefiles(countrycode,level=0,force=False,verbose=0):            
      """
      Downloads a shapefile from gadm to the data/shapefiles folder
      
      Parameters
      ----------
      countrycode : str
          Three letter ISO 3166-1 alpha-3 country code
          
      level : int
          Administrative level 0-5
          
      force : boolean
          Set to true to force the download and overwrite existing files
          
      verbose : int
          Specify output printing during the process
          
      """
      
      shpname = '{}_adm{}.shp'.format(countrycode,level)
      shxname = '{}_adm{}.shx'.format(countrycode,level)
      dbfname = '{}_adm{}.dbf'.format(countrycode,level)
      
      # all extensions in the zip file are:
      # '.cpg','.csv','.dbf','.prj','.shp','.shx'
      
      unzip = False
      for filename in [shpname,shxname,dbfname]:
          if force or not os.path.isfile( os.path.join(data_path,'shapefiles',format(filename)) ):
              unzip = True
              break
              
      if unzip:
          zipname = '{}_adm_shp.zip'.format(countrycode)
          zippath = os.path.join(data_path,'shapefiles',zipname)
          if force or not os.path.isfile( zippath ):
              # download the file
              # http://biogeo.ucdavis.edu/data/gadm2.8/shp/DZA_adm_shp.zip
              url = 'http://biogeo.ucdavis.edu/data/gadm2.8/shp/{}'.format(zipname)
              if verbose > 0:
                  print('downloading shapefile for {} from:\n {}'.format(countrycode,url))
                      
              try:
                  request.urlretrieve(url, zippath)
              except:
                  raise Exception('Could not download the shp file from {}'.format(url))
  
          # unzip
          if verbose > 0:
              print('unzipping files')
                  
          with zipfile.ZipFile(zippath, 'r') as zfile:
              for filename in [shpname,shxname,dbfname]:
                  zfile.extract(filename, os.path.join(data_path,'shapefiles'))
  
          if verbose > 0:
              print('done')
code_tokens: def download_shapefiles ( countrycode , level = 0 , force = False , verbose = 0 ) : shpname = '{}_adm{}.shp' . format ( countrycode , level ) shxname = '{}_adm{}.shx' . format ( countrycode , level ) dbfname = '{}_adm{}.dbf' . format ( countrycode , level ) unzip = False for filename in [ shpname , shxname , dbfname ] : if force or not os . path . isfile ( os . path . join ( data_path , 'shapefiles' , format ( filename ) ) ) : unzip = True break if unzip : zipname = '{}_adm_shp.zip' . format ( countrycode ) zippath = os . path . join ( data_path , 'shapefiles' , zipname ) if force or not os . path . isfile ( zippath ) : url = 'http://biogeo.ucdavis.edu/data/gadm2.8/shp/{}' . format ( zipname ) if verbose > 0 : print ( 'downloading shapefile for {} from:\n {}' . format ( countrycode , url ) ) try : request . urlretrieve ( url , zippath ) except : raise Exception ( 'Could not download the shp file from {}' . format ( url ) ) if verbose > 0 : print ( 'unzipping files' ) with zipfile . ZipFile ( zippath , 'r' ) as zfile : for filename in [ shpname , shxname , dbfname ] : zfile . extract ( filename , os . path . join ( data_path , 'shapefiles' ) ) if verbose > 0 : print ( 'done' )
short_docstring: Downloads a shapefile from gadm to the data/shapefiles folder
  Parameters
short_docstring_tokens: Downloads a shapefile from gadm to the data / shapefiles folder Parameters
comment: """
      Downloads a shapefile from gadm to the data/shapefiles folder
      
      Parameters
      ----------
      countrycode : str
          Three letter ISO 3166-1 alpha-3 country code
          
      level : int
          Administrative level 0-5
          
      force : boolean
          Set to true to force the download and overwrite existing files
          
      verbose : int
          Specify output printing during the process
          
      """$SEP$# all extensions in the zip file are:$SEP$# '.cpg','.csv','.dbf','.prj','.shp','.shx'$SEP$# download the file$SEP$# http://biogeo.ucdavis.edu/data/gadm2.8/shp/DZA_adm_shp.zip$SEP$# unzip