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

def describe_usage_plans(name=None, plan_id=None, region=None, key=None, keyid=None, profile=None):
    '''
    Returns a list of existing usage plans, optionally filtered to match a given plan name

    .. versionadded:: 2017.7.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_usage_plans
        salt myminion boto_apigateway.describe_usage_plans name='usage plan name'
        salt myminion boto_apigateway.describe_usage_plans plan_id='usage plan id'

    '''
    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        plans = _multi_call(conn.get_usage_plans, 'items')
        if name:
            plans = _filter_plans('name', name, plans)
        if plan_id:
            plans = _filter_plans('id', plan_id, plans)

        return {'plans': [_convert_datetime_str(plan) for plan in plans]}

    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}