19 return "" 20 21 lines = text.splitlines() 22 random.seed(seed) 23 random_line = random.choice(lines) 24 return random_line 25 26 class MultiTextMerge:
101 102 def get_random_line(self, textt, seed): 103 lines = textt.splitlines() 104 random.seed(seed) 105 random_line = random.choice(lines) 106 return random_line 107 108 def get_random_line4(self, seed, delimiter, text1='', text2='', text3='', text4=''):
185 186 if line.startswith("?"): 187 line = line[1:] 188 perc = self.line_perc(line) 189 if random.random() > perc: 190 continue 191 line = self.get_perc_text(line) 192
218 return re.sub(r'\s+', ' ', input.strip()) 219 220 def replace_random(self, match): 221 options = match.group(1).split('*') 222 return random.choice(options) 223 224 def select_random_from_braces(self, input): 225 pattern = r'\[(.*?)\]'
270 if num_choices: 271 # Randomly select between n-m choices 272 if '-' in num_choices: 273 start, end = map(int, num_choices.split('-')) 274 n = random.randint(start, end) 275 # Randomly select n choices 276 else: 277 n = int(num_choices)
607 608 dir_files = sorted(dir_files) 609 610 random.seed(seed) 611 random_index = random.randint(0, len(dir_files) - 1) 612 image_path = dir_files[random_index] 613 614 i = Image.open(image_path)