boto/jmespath — pull request #20 by jamesls (2013-11-21 01:01:06+00:00)
Title: Add a flatten operator that supports wildcard projections

There have been requests to add an operator that will merge/flatten sublists. For example, given something like this:

```
[ [1, 2, 3], [4, 5, 6], [7, 8, 9]]
```

It should be possible to get:

```
[1, 2, 3, 4, 5, 6, 7 ,8, 9]
```

The proposed syntax has an updated grammar of `bracket-specifier = "[" (number / "*") "]" / "[]"`
When this is encountered any sublists in a list are merged into the parent list.

Updated spec/compliance tests are included.

I've also moved out the wildcard syntax `[*]` out of indices.json and into `wildcard.json`

On a practical level, this enable things like this in the AWS CLI:

```
$ aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId, State.Name]'
[
[
"i-123",
"stopped"
],
[
"i-123",
"running"
],
[
"i-123",
"stopped"
],
[
"i-123",
"running"
],
[
"i-cc07a7fb",
"running"
],
[
"i-123",
"stopped"
]
]
```

Note how you just have a list of instances instead of the extra nesting you get from the reservations list using the `Reservations[*].Instances[*].[InstanceId,State.Name]` version.

cc @mtdowling @trevorrowe