(column_names: list, values: list)
| 442 | |
| 443 | |
| 444 | def nice_look_table(column_names: list, values: list): |
| 445 | rows = [] |
| 446 | # Determine the maximum width of each column |
| 447 | widths = [max(len(str(value[i])) for value in values + [column_names]) for i in range(len(column_names))] |
| 448 | |
| 449 | # Print the column names |
| 450 | header = ''.join(f'{column.rjust(width)} ' for column, width in zip(column_names, widths)) |
| 451 | # print(header) |
| 452 | # Print the values |
| 453 | for value in values: |
| 454 | row = ''.join(f'{str(v).rjust(width)} ' for v, width in zip(value, widths)) |
| 455 | rows.append(row) |
| 456 | rows = "\n".join(rows) |
| 457 | final_output = header + '\n' + rows |
| 458 | return final_output |
| 459 | |
| 460 | |
| 461 | def generate_db_prompt_bird_v2(root_dir, dataset, db_id, limit_value=3): |
no outgoing calls
no test coverage detected