paopaoka3325 commited on
Commit
bc0561b
·
1 Parent(s): bb0161f

Add application files

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -53,6 +53,18 @@ def greet(name1, name2):
53
  # Splitting the data string into lines and then split each line into key-value pairs
54
  key_value_pairs = [line.split(": ", 1) for line in output.split("\n")[1:] if line.strip()]
55
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  key_value_pairs = [[format_identifier(x[0]), *x[1:]] for x in key_value_pairs]
57
 
58
  # Convert the key-value pairs into a table format (a list of lists)
 
53
  # Splitting the data string into lines and then split each line into key-value pairs
54
  key_value_pairs = [line.split(": ", 1) for line in output.split("\n")[1:] if line.strip()]
55
 
56
+ def format_identifier(identifier: str) -> str:
57
+ # Split the string by underscores
58
+ words = identifier.strip().split('_')
59
+
60
+ # Capitalize each word
61
+ capitalized_words = [word.capitalize() for word in words]
62
+
63
+ # Join the words with spaces
64
+ formatted_identifier = ' '.join(capitalized_words)
65
+
66
+ return formatted_identifier
67
+
68
  key_value_pairs = [[format_identifier(x[0]), *x[1:]] for x in key_value_pairs]
69
 
70
  # Convert the key-value pairs into a table format (a list of lists)