<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve_available_slots(self, worksheet_template, type='a'):
 """Returns the available slots from the current worksheet that fits with the layout defined in the worksheet_template and type of analysis passed in. Allowed type of analyses are: 'a' (routine analysis) 'b' (blank analysis) 'c' (control) 'd' (duplicate) :param worksheet_template: the worksheet template to match against :param type: type of analyses to restrict that suit with the slots :return: a list of slots positions """

        if not worksheet_template or type not in ALLOWED_ANALYSES_TYPES:
            return list()

        ws_slots = self.get_slot_positions(type)
        layout = worksheet_template.getLayout()
        slots = list()

        for row in layout:
            # skip rows that do not match with the given type
            if row['type'] != type:
                continue

            slot = to_int(row['pos'])

            if slot in ws_slots:
                # We only want those that are empty
                continue

            slots.append(slot)
        return slots