original_docstring: Download a file from S3
      Parameters
      ----------
      filename: string, required
          Name of the file in S3 source bucket (OpenAQ)
      Returns
      -------
      data_file: string
          Local path to downloaded file
      
docstring: Download a file from S3
  Parameters
  
  string, required
  Name of the file in S3 source bucket (OpenAQ)
  Returns
  
  string
  Local path to downloaded file
docstring_tokens: Download a file from S3 Parameters string required Name of the file in S3 source bucket ( OpenAQ ) Returns string Local path to downloaded file
code: def download_data(filename):
      """Download a file from S3
      Parameters
      ----------
      filename: string, required
          Name of the file in S3 source bucket (OpenAQ)
      Returns
      -------
      data_file: string
          Local path to downloaded file
      """
  
      xray_recorder.begin_subsegment('## download_data_file')
      subsegment = xray_recorder.current_subsegment()
      subsegment.put_metadata('filename', f's3://{src_bucket}/{filename}')
  
      try:
          data_file = os.path.join('/tmp', os.path.basename(filename))
          s3.download_file(src_bucket, filename, data_file)
          subsegment.put_annotation('DATA_DOWNLOAD', 'SUCCESS')
      except botocore.exceptions.ClientError as e:
          subsegment.put_annotation('DATA_DOWNLOAD', 'FAILURE')
          log.error(f'Unable to download data: {filename}')
          log.debug(e)
          raise
      xray_recorder.end_subsegment()
      return data_file
code_tokens: def download_data ( filename ) : xray_recorder . begin_subsegment ( '## download_data_file' ) subsegment = xray_recorder . current_subsegment ( ) subsegment . put_metadata ( 'filename' , f's3://{src_bucket}/{filename}' ) try : data_file = os . path . join ( '/tmp' , os . path . basename ( filename ) ) s3 . download_file ( src_bucket , filename , data_file ) subsegment . put_annotation ( 'DATA_DOWNLOAD' , 'SUCCESS' ) except botocore . exceptions . ClientError as e : subsegment . put_annotation ( 'DATA_DOWNLOAD' , 'FAILURE' ) log . error ( f'Unable to download data: {filename}' ) log . debug ( e ) raise xray_recorder . end_subsegment ( ) return data_file
short_docstring: Download a file from S3
  Parameters
short_docstring_tokens: Download a file from S3 Parameters
comment: """Download a file from S3
      Parameters
      ----------
      filename: string, required
          Name of the file in S3 source bucket (OpenAQ)
      Returns
      -------
      data_file: string
          Local path to downloaded file
      """