ENH: Allow sorting of a dataframe on a boolean/function?
From searching variants of the phrase "sort pandas on boolean," I don't think the feature I am describing is doable in an easy way at this point, so I think it's a good candidate for a feature. It might not be possible in the way I'm envisioning, but I'm interested in whether or not the base feature can be done.

Forgive me if there is a way to do what I'm getting at, and I just haven't found it- I don't mean to use this as a stack overflow page, but I genuinely think there is no feature like I'm describing.

So here's an example of a dataframe, which has two string fields that I want to sort on. The issue is that one of the string fields is generated partially from user entry, so I have little control over what is in the field. It looks like:

``` Python
>>> df = pd.DataFrame({
>>>    "NBR": ['B3', 'A1', 'C3', 'D5', 'A2', 'B1'],
>>>    "DESCR": [
>>>        'GADGET',
>>>        'GIZMO THAT IS BLUE',
>>>        'GIZMO THAT WHIRS',
>>>        'GADGET WITH CHEESE',
>>>        'GADGET THAT IS BIG',
>>>        'GIZMO THAT IS ROUND'
>>>     ]
>>>    })
>>> df
  NBR                DESCR
0  B3               GADGET
1  A1   GIZMO THAT IS BLUE
2  C3     GIZMO THAT WHIRS
3  D5   GADGET WITH CHEESE
4  A2   GADGET THAT IS BIG
5  B1  GIZMO THAT IS ROUND
```
Every row is either a gizmo or a gadget, so I want to sort on that category. Then, I want to sort on the number of the part. 
Sorting on DESCR doesn't give the desired result- in this example, since B3 has a description that is alphabetically before A1, it would be sorted first. However, I want them to be sorted based on the category of gizmo or gadget.

That is:
``` Python
>>># not desired result
>>>df.sort_values(['DESCR', 'NBR'])
  NBR                DESCR
0  B3               GADGET
4  A2   GADGET THAT IS BIG
3  D5   GADGET WITH CHEESE
1  A1   GIZMO THAT IS BLUE
5  B1  GIZMO THAT IS ROUND
2  C3     GIZMO THAT WHIRS
>>># desired result requires a column/intermediary category or series
>>># example of intermediary method
>>>df['TYPE'] = df.DESCR.apply(lambda s: "GIZMO" if s.startswith('GIZMO') else 'GADGET')
>>>df
  NBR                DESCR    TYPE
0  B3               GADGET  GADGET
1  A1   GIZMO THAT IS BLUE   GIZMO
2  C3     GIZMO THAT WHIRS   GIZMO
3  D5   GADGET WITH CHEESE  GADGET
4  A2   GADGET THAT IS BIG  GADGET
5  B1  GIZMO THAT IS ROUND   GIZMO

>>>df.sort_values(['TYPE', 'NBR'])
  NBR                DESCR    TYPE
4  A2   GADGET THAT IS BIG  GADGET
0  B3               GADGET  GADGET
3  D5   GADGET WITH CHEESE  GADGET
1  A1   GIZMO THAT IS BLUE   GIZMO
5  B1  GIZMO THAT IS ROUND   GIZMO
2  C3     GIZMO THAT WHIRS   GIZMO

>>># finally, the desired result
>>>df = df.sort_values(['TYPE', 'NBR']).drop(columns='TYPE')
>>>df
  NBR                DESCR
4  A2   GADGET THAT IS BIG
0  B3               GADGET
3  D5   GADGET WITH CHEESE
1  A1   GIZMO THAT IS BLUE
5  B1  GIZMO THAT IS ROUND
2  C3     GIZMO THAT WHIRS

>>># suggested syntax
>>>df.sort_values([lambda x: x.startswith('GIZMO'), 'NBR']
```
The issue I have with this is that there are multiple conditional sorts that I'm performing before the normal, column based sort, and the dataframe is large enough where creating the extra column is not desired.

I'm open to the possibility that this is just impractical to implement, or a bad idea for some reason, and the intermediary is the way to go. 

I'd love to work on this myself, but I'm not very familiar with pandas source code yet. I'll keep playing and see if I can figure out an implementation :)