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

def pipeline_id_from_name(name, region=None, key=None, keyid=None, profile=None):
    '''
    Get the pipeline id, if it exists, for the given name.

    CLI example:

    .. code-block:: bash

        salt myminion boto_datapipeline.pipeline_id_from_name my_pipeline_name
    '''
    r = {}
    result_pipelines = list_pipelines()
    if 'error' in result_pipelines:
        return result_pipelines

    for pipeline in result_pipelines['result']:
        if pipeline['name'] == name:
            r['result'] = pipeline['id']
            return r
    r['error'] = 'No pipeline found with name={0}'.format(name)
    return r