<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def snapshot_name_to_id(name, snap_name, strict=False, runas=None):
    '''
    Attempt to convert a snapshot name to a snapshot ID.  If the name is not
    found an empty string is returned.  If multiple snapshots share the same
    name, a list will be returned

    :param str name:
        Name/ID of VM whose snapshots are inspected

    :param str snap_name:
        Name of the snapshot

    :param bool strict:
        Raise an exception if multiple snapshot IDs are found

    :param str runas:
        The user that the prlctl command will be run as

    CLI Example:

    .. code-block:: bash

        salt '*' parallels.snapshot_id_to_name macvm original runas=macdev
    '''
    # Validate VM and snapshot names
    name = salt.utils.data.decode(name)
    snap_name = salt.utils.data.decode(snap_name)

    # Get a multiline string containing all the snapshot GUIDs
    info = prlctl('snapshot-list', name, runas=runas)

    # Get a set of all snapshot GUIDs in the string
    snap_ids = _find_guids(info)

    # Try to match the snapshot name to an ID
    named_ids = []
    for snap_id in snap_ids:
        if snapshot_id_to_name(name, snap_id, runas=runas) == snap_name:
            named_ids.append(snap_id)

    # Return one or more IDs having snap_name or raise an error upon
    # non-singular names
    if not named_ids:
        raise SaltInvocationError(
            'No snapshots for VM "{0}" have name "{1}"'.format(name, snap_name)
        )
    elif len(named_ids) == 1:
        return named_ids[0]
    else:
        multi_msg = ('Multiple snapshots for VM "{0}" have name '
                     '"{1}"'.format(name, snap_name))
        if strict:
            raise SaltInvocationError(multi_msg)
        else:
            log.warning(multi_msg)
        return named_ids