def absent(name, directory_id=None):
    '''
    Ensure that an account associated with the given email address is absent.
    Will search all directories for the account, unless a directory_id is
    specified.

    name
        The email address of the account to delete.

    directory_id
        Optional. The ID of the directory that the account is expected to belong
        to. If not specified, then a list of directories will be retrieved, and
        each will be scanned for the account. Specifying a directory_id will
        therefore cut down on the number of requests to Stormpath, and increase
        performance of this state.
    '''
    # Because __opts__ is not available outside of functions
    if __opts__.get('requests_lib', False):
        from requests.exceptions import HTTPError
    else:
        from urllib2 import HTTPError

    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}
    info = {}
    if directory_id is None:
        dirs = __salt__['stormpath.list_directories']()
        for dir_ in dirs.get('items', []):
            try:
                comps = dir_.get('href', '').split('/')
                directory_id = comps[-1]
                info = __salt__['stormpath.show_account'](email=name, directory_id=directory_id)
                if len(info.get('items', [])) > 0:
                    info = info['items'][0]
                    break
            except __HOLE__:
                pass
    else:
        info = __salt__['stormpath.show_account'](email=name, directory_id=directory_id)
        info = info['items'][0]
    if 'items' in info:
        ret['result'] = True
        ret['comment'] = 'Stormpath account {0} already absent'.format(name)
        return ret
    if __opts__['test']:
        ret['comment'] = 'Stormpath account {0} needs to be deleted'.format(name)
        return ret
    comps = info['href'].split('/')
    account_id = comps[-1]
    if __salt__['stormpath.delete_account'](account_id):
        ret['changes'] = {'deleted': account_id}
        ret['result'] = True
        ret['comment'] = 'Stormpath account {0} was deleted'.format(name)
        return ret
    else:
        ret['result'] = False
        ret['comment'] = 'Failed to delete Stormpath account {0}'.format(name)
        return ret
dataset/ETHPy150Open saltstack/salt/salt/states/stormpath_account.py/absent