Randomly sample n items from data. If data has fewer items than n, return all data
(data, n)
| 70 | |
| 71 | |
| 72 | def random_sample(data, n): |
| 73 | """Randomly sample n items from data. If data has fewer items than n, return all data""" |
| 74 | if len(data) <= n: |
| 75 | return data |
| 76 | return random.sample(data, n) |
| 77 | |
| 78 | |
| 79 | def get_task_name(file_path): |
no test coverage detected