@staticmethod
def prepare_target_to_erase(target_id, available_devices):
    """
        prepare target to erase
        """
    targets_to_erase = []
    if isinstance(target_id, list):
        for target in target_id:
            for device in available_devices:
                if target == device['target_id']:
                    if device not in targets_to_erase:
                        targets_to_erase.append(device)
    elif target_id == 'all':
        targets_to_erase = 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):
                if device not in targets_to_erase:
                    targets_to_erase.append(device)
    return targets_to_erase
