def METHOD_NAME(self, presentations, practices, months):
    prescribing = []
    for month in months:
        practice_codes_used = set()
        for presentation in presentations:
            # For each presentation in each month, choose a random subset
            # of practices to prescribe it
            n = self.random.randint(1, len(practices))
            selected_practices = self.random.sample(practices, n)
            for practice in selected_practices:
                prescribing.append(
                    self.create_prescription(presentation, practice, month)
                )
                practice_codes_used.add(practice["code"])
        # Make sure each practice prescribes at least one thing each month
        for practice in practices:
            if practice["code"] not in practice_codes_used:
                presentation = self.random.choice(presentations)
                prescribing.append(
                    self.create_prescription(presentation, practice, month)
                )
    return prescribing