def header_string(headers_dict):
 header_list = []
 if ('Content-Type' in headers_dict):
  header_list.append((headers_dict['Content-Type'] + '\n'))
 if ('Date' in headers_dict):
  header_list.append((headers_dict['Date'] + '\n'))
 if ('Content-MD5' in headers_dict):
  header_list.append((headers_dict['Content-MD5'] + '\n'))
 return ''.join(header_list)

def header_string ( headers_dict ) : header_list = [ ] if ( 'Content-Type' in headers_dict ) : header_list . append ( ( headers_dict [ 'Content-Type' ] + '\n' ) ) if ( 'Date' in headers_dict ) : header_list . append ( ( headers_dict [ 'Date' ] + '\n' ) ) if ( 'Content-MD5' in headers_dict ) : header_list . append ( ( headers_dict [ 'Content-MD5' ] + '\n' ) ) return '' . join ( header_list )
given a dictionary of headers .