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

def list_grants(key_id, limit=None, marker=None, region=None, key=None,
                keyid=None, profile=None):
    '''
    List grants for the specified key.

    CLI example::

        salt myminion boto_kms.list_grants 'alias/mykey'
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    if key_id.startswith('alias/'):
        key_id = _get_key_id(key_id)
    r = {}
    try:
        _grants = []
        next_marker = None
        while True:
            grants = conn.list_grants(
                key_id,
                limit=limit,
                marker=next_marker
            )
            for grant in grants['Grants']:
                _grants.append(grant)
            if 'NextMarker' in grants:
                next_marker = grants['NextMarker']
            else:
                break
        r['grants'] = _grants
    except boto.exception.BotoServerError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r