human
Can you show me a Python function to repeat each element of the list n times.
assistant
Here is a Python function to repeat each element of the list n times

import re

def repeat(list, n):
    """Repeat each element of list n times"""
    return [item for item in list for _ in range(n)]

# Enter the list
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

# Calling the function
print((repeat(list1, 2)))

#Example Output
# [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]

#Remember to inspect code for bugs.