AI-MTHRFCKR

AI-MTHRFCKR

3219 bookmarks
Custom sorting
bloop
bloop
Ask questions in natural language, search for code and generate patches using your existing codebase as context
·bloop.ai·
bloop
Morph
Morph
import randomdef create_task_automations(): """ Function to create a set of task automations with unique tasks and subtasks. Returns: - dict: A dictionary containing the task automations for each hour and day of the week. The keys of the dictionary represent the hour of the day (0-23) and the values are sets of unique tasks. """ # List of days of the week days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] # Dictionary to store the task automations task_automations = {} # Loop through each hour of the day for hour in range(24): # Set to store the unique tasks for the current hour tasks = set() # Loop through each day of the week for day in days_of_week: # Generate a random task for the current hour and day task = generate_task() # Check if the task is already assigned for the current hour while task in tasks: task = generate_task() # Add the task to the set of tasks for the current hour tasks.add(task) # Add the set of tasks to the task automations dictionary for the current hour task_automations[hour] = tasks return task_automationsdef generate_task(): """ Function to generate a random task. Returns: - str: A randomly generated task. """ # List of subtasks subtasks = [ "Subtask 1", "Subtask 2", "Subtask 3", "Subtask 4", "Subtask 5", "Subtask 6", "Subtask 7", "Subtask 8", "Subtask 9", "Subtask 10", "Subtask 11", "Subtask 12", "Subtask 13", "Subtask 14", "Subtask 15", "Subtask 16", "Subtask 17", "Subtask 18", "Subtask 19", "Subtask 20", "Subtask 21", "Subtask 22", "Subtask 23", "Subtask 24" ] # Shuffle the list of subtasks random.shuffle(subtasks) # Select the first 7 subtasks from the shuffled list task = subtasks[:7] return task# Unit tests for create_task_automations function.import unittestclass TestCreateTaskAutomations(unittest.TestCase): def test_create_task_automations(self): """ Tests if the task automations are created correctly. """ task_automations = create_task_automations() # Check if the task automations dictionary has 24 keys (hours) self.assertEqual(len(task_automations), 24) # Check if each hour has a set of 7 unique tasks for hour, tasks in task_automations.items(): self.assertEqual(len(tasks), 7) # Check if no task is repeated for any hour or day all_tasks = set() for tasks in task_automations.values(): all_tasks.update(tasks) self.assertEqual(len(all_tasks), 24 * 7)# Example of using the create_task_automations function:task_automations = create_task_automations()# Print the task automations for each hour and day of the weekfor hour, tasks in task_automations.items(): print(f"Hour: {hour}") for day, task in zip(days_of_week, tasks): print(f" {day}: {task}") print()# Run the unit testsunittest.main()
·morph.so·
Morph
Kombai
Kombai
Convert your Figma designs to flawless front-end code effortlessly with Kombai.com's AI-powered Figma to code conversion tool. Unlock the potential of automated development handoff, save time, and bring your designs to life with pixel-perfect precision.
·kombai.com·
Kombai
LANDR
LANDR
Offers AI-powered online mastering, a marketplace for production tools, and music distribution to streaming platforms
·landr.com·
LANDR