def sort(df, columns: Union[str, List[str]], order: Union[str, List[str]] = '<STR_LIT>'):
if isinstance(columns, str):<EOL><INDENT>columns = [columns]<EOL><DEDENT>if isinstance(order, str):<EOL><INDENT>assert order in ['<STR_LIT>', '<STR_LIT>']<EOL>orders = [order == '<STR_LIT>'] * len(columns)<EOL><DEDENT>else:<EOL><INDENT>assert len(order) == len(columns), "<STR_LIT>""<STR_LIT>"<EOL>orders = []<EOL>for ord in order:<EOL><INDENT>assert ord in ['<STR_LIT>', '<STR_LIT>'], f"<STR_LIT>""<STR_LIT>"<EOL>orders.append(ord == '<STR_LIT>')<EOL><DEDENT><DEDENT>return df.sort_values(columns, ascending=orders)<EOL>
Sort the data by the value in specified columns

---

### Parameters

*mandatory :*
- `columns` (*str* or *list(str)*): list of columns to order

*optional :*
- `order` (*str* or *list(str)*): the ordering condition ('asc' for
ascending or 'desc' for descending). If not specified, 'asc' by default.
If a list of columns has been specified for the `columns` parameter,
the `order` parameter, if explicitly specified, must be a list of same
length as the `columns` list (if a string is specified, it will be
replicated in a list of same length of the `columns` list)

---

### Example

**Input**

| variable | value |
|:--------:|:-----:|
|     A    |  220  |
|     B    |  200  |
|     C    |  300  |
|     D    |  100  |

```cson
sort:
  columns: 'value'
```

**Output**

| variable | value |
|:--------:|:-----:|
|     D    |  100  |
|     B    |  200  |
|     A    |  220  |
|     C    |  300  |