def list_policies(iam, only_attached=False, path_prefix='/', scope='All',
    marker=None, max_items=100):
    """
    List policies available.

    If only_attached is True, the results are limited to policies attached to
    roles.

    path_prefix can be used to filter results.  This defaults to '/', returning
    all policies.

    scope can be 'AWS' for AWS-managed policies, 'Local' for customer-managed
    policies, or 'All'.

    max_items and marker are used for pagination.  max_items defaults to 100.
    If there are additional results available, the result will have the
    is_truncated flag set and include a marker to retrieve the next page of
    results.
    """
    parameters = {'OnlyAttached': 'true' if only_attached else 'false',
        'PathPrefix': path_prefix, 'Scope': scope, 'MaxItems': max_items}
    if marker is not None:
        parameters['Marker'] = marker
    return iam.get_response('ListPolicies', parameters, list_marker='Policies')
