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

def delete_resource(resource_name, key, identifier_fields, profile='pagerduty', subdomain=None, api_key=None):
    '''
    delete any pagerduty resource

    Helper method for absent()

    example:
            delete_resource("users", key, ["id","name","email"]) # delete by id or name or email

    '''
    resource = get_resource(resource_name, key, identifier_fields, profile, subdomain, api_key)
    if resource:
        if __opts__['test']:
            return 'would delete'
        # flush the resource_cache, because we're modifying a resource
        del __context__['pagerduty_util.resource_cache'][resource_name]
        resource_id = _get_resource_id(resource)
        return _query(method='DELETE', action='{0}/{1}'.format(resource_name, resource_id), profile=profile, subdomain=subdomain, api_key=api_key)
    else:
        return True