@staticmethod
def prepare_target_to_reset(target_id, available_devices):
    """
        prepare target to reset
        """
    targets_to_reset = []
    if isinstance(target_id, list):
        for target in target_id:
            for device in available_devices:
                if target == device['target_id'
                    ] and device not in targets_to_reset:
                    targets_to_reset.append(device)
    elif target_id == 'all':
        targets_to_reset = available_devices
    elif len(target_id) <= 48:
        for device in available_devices:
            if (target_id == device['target_id'] or device['target_id'].
                startswith(target_id)) and device not in targets_to_reset:
                targets_to_reset.append(device)
    return targets_to_reset
