Skip to content

Latest commit

 

History

History
169 lines (167 loc) · 4.27 KB

27.md

File metadata and controls

169 lines (167 loc) · 4.27 KB

Results of GPT-4 on HumanEval/27

Date: 18 July, 2023
Model: gpt-4
Temperature: 0.2
Passing runs: 10
Total runs: 10
Success rate: 100%

Prompt

Tokens: 74

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """

The above is an incomplete Python code fragment. Return the complete and correct code with no additional text.

Correct solution

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """return string.swapcase()

Unit tests

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


def check(candidate):
    assert candidate('') == ''
    assert candidate('Hello!') == 'hELLO!'
    assert candidate('These violent delights have violent ends') == 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'

Runs

✅ Run 1

Start time: 2023-07-18 18:46:32
Duration: 6.52s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 2

Start time: 2023-07-18 18:46:27
Duration: 5.35s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 3

Start time: 2023-07-18 18:46:22
Duration: 4.51s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 4

Start time: 2023-07-18 18:46:17
Duration: 5.09s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 5

Start time: 2023-07-18 18:46:11
Duration: 5.74s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 6

Start time: 2023-07-18 18:46:06
Duration: 5.82s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 7

Start time: 2023-07-18 18:46:01
Duration: 4.66s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 8

Start time: 2023-07-18 18:45:56
Duration: 4.71s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 9

Start time: 2023-07-18 18:45:50
Duration: 6.03s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()

✅ Run 10

Start time: 2023-07-18 18:45:45
Duration: 5.08s
Completion tokens: 52
Result: Pass

def flip_case(string: str) -> str:
    """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
    >>> flip_case('Hello')
    'hELLO'
    """
    return string.swapcase()