← run

he-019

0.000
0/1 tests· algorithms
Challenge · difficulty 3/5
# HumanEval/19

Implement a file **`solution.py`** that completes the function below. Keep the given name and signature; your file must define it at module level.

```python
from typing import List


def sort_numbers(numbers: str) -> str:
    """ Input is a space-delimited string of numberals from 'zero' to 'nine'.
    Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
    Return the string with numbers sorted from smallest to largest
    >>> sort_numbers('three one five')
    'one three five'
    """
```

<!-- imported from OpenAI HumanEval (HumanEval/19) -->
tests/test_he_019.py
# Auto-generated from OpenAI HumanEval HumanEval/19. Do not edit by hand.
from solution import *  # noqa: F401,F403 (prompt helpers may be referenced by tests)
from solution import sort_numbers as candidate

METADATA = {
    'author': 'jt',
    'dataset': 'test'
}


def check(candidate):
    assert candidate('') == ''
    assert candidate('three') == 'three'
    assert candidate('three five nine') == 'three five nine'
    assert candidate('five zero four seven nine eight') == 'zero four five seven eight nine'
    assert candidate('six five four three two one zero') == 'zero one two three four five six'


def test_he_019():
    check(candidate)
Proposed solution
```python
def sort_numbers(numbers: str) -> str:
    """
    This function returns the sorted list of numbers.
    It takes a string of numbers as input and returns a string of numbers as output.
    It can be called recursively to sort numbers in a chain.
    It can be called recursively to sort numbers in a chain.
    It can be called recursively to split numbers into digits.
    It can be called recursively to split numbers into groups.
    It can be called recursively to split numbers into groups.
    It can be called recursively to split numbers into groups.
    It can be called recursively to split numbers into groups.
    It can be called recursively to split numbers into groups.
    It can be called recursively to split numbers into groups.
   

Errors (stderr)

no code extracted from response