parameters: (filepath, rows)
docstring: Write out the data provied in a tab-delimited CSV format
  
      filepath: The filepath to write the data to
      rows: An iterable of dictionary-like elements; each element
            provides a set key-value pairs corresponding to a row
            in the output file
docstring_summary: Write out the data provied in a tab-delimited CSV format
docstring_tokens: Write out the data provied in a tab - delimited CSV format
function: def write_tab_delimitted_csv(filepath, rows):
      """
      Write out the data provied in a tab-delimited CSV format
  
      filepath: The filepath to write the data to
      rows: An iterable of dictionary-like elements; each element
            provides a set key-value pairs corresponding to a row
            in the output file
      """
      # Calculate the max width of each column
      columns = OrderedDict()
      for row in rows:
          for key, value in row.items():
  
              if key not in columns:
                  columns[key] = max(len(key), len(str(value)))
              else:
                  columns[key] = max(columns[key], len(str(value)))
  
      # Write the elements
      with open(filepath, "w+") as file:
          writer = csv.writer(file, delimiter="\t")
  
          # Write out the header
          header = []
          for col_name, col_width in columns.items():
              header.append("{:{width}}".format(col_name, width=col_width))
          writer.writerow(header)
  
          # Write rows
          for row in rows:
              values = []
              for col_name, col_width in columns.items():
                  values.append("{:{width}}".format(row[col_name], width=col_width))
              writer.writerow(values)
function_tokens: def write_tab_delimitted_csv ( filepath , rows ) : # Calculate the max width of each column columns = OrderedDict ( ) for row in rows : for key , value in row . items ( ) : if key not in columns : columns [ key ] = max ( len ( key ) , len ( str ( value ) ) ) else : columns [ key ] = max ( columns [ key ] , len ( str ( value ) ) ) # Write the elements with open ( filepath , "w+" ) as file : writer = csv . writer ( file , delimiter = "\t" ) # Write out the header header = [ ] for col_name , col_width in columns . items ( ) : header . append ( "{:{width}}" . format ( col_name , width = col_width ) ) writer . writerow ( header ) # Write rows for row in rows : values = [ ] for col_name , col_width in columns . items ( ) : values . append ( "{:{width}}" . format ( row [ col_name ] , width = col_width ) ) writer . writerow ( values )