Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions evaluator/datasets/polyglot_js/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Added typing to `promisify()`, `all()`, `allSettled()`, `race()`, and `any()`, a

## proverb

Added the complete function signature with typing for `proverb()`, including the `...args` rest parameter, as the `main.js` file had no parameters at all.
Added the complete function signature with typing for `proverb()`, including the `...args` rest parameter, as the `main.js` file had no parameters at all. Explained where the qualifier should be used.

## pythagorean-triplet

Expand Down Expand Up @@ -400,7 +400,7 @@ Added the missing `name` property and `reset()` method with type hints. The inst

## robot-simulator

Added typing to `Robot.bearing`, `Robot.coordinates`, `Robot.place()`, and `Robot.evaluate()`, as it is unclear what the parameter types should be and what the methods should return.
Added typing to `Robot.bearing`, `Robot.coordinates`, `Robot.place()`, and `Robot.evaluate()`, as it is unclear what the parameter types should be, what errors should be thrown, and what the methods should return.

## roman-numerals

Expand Down
2 changes: 1 addition & 1 deletion evaluator/datasets/polyglot_js/proverb/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//

/**
* @param {...string} args
* @param {...string | {qualifier: string}} args - The last argument may be an object with a `qualifier` property. The qualifier should go before the first argument in the conclusion.
* @return {string}
*/
export const proverb = (...args) => {
Expand Down
7 changes: 4 additions & 3 deletions evaluator/datasets/polyglot_js/robot-simulator/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@ export class InvalidInputError extends Error {

export class Robot {
/**
* @returns {string}
* @returns {'north' | 'east' | 'south' | 'west'}
*/
get bearing() {
throw new Error('Remove this line and implement the function');
}

/**
* @returns {number[]}
* @returns {[number, number]}
*/
get coordinates() {
throw new Error('Remove this line and implement the function');
}

/**
* @param {{x: number, y: number, direction: string}} position
* @param {{x: number, y: number, direction: 'north' | 'east' | 'south' | 'west'}} position
* @throws {InvalidInputError}
*/
place({ x, y, direction }) {
throw new Error('Remove this line and implement the function');
Expand Down
4 changes: 2 additions & 2 deletions evaluator/datasets/polyglot_py/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Added typing to `recite()`, as it is unclear what the parameter types should be

## forth

Added typing to `evaluate()`, as it is unclear what the parameter type should be and what the function should return. There are some links that are impossible for the agent to follow. This will be resolved in a future version of our sandbox, where we provide restricted Internet access.
Added typing to `evaluate()`, as it is unclear what the parameter type should be and what the function should return. Added a missing exception message in the instructions that the tests look for. There are some links that are impossible for the agent to follow. This will be resolved in a future version of our sandbox, where we provide restricted Internet access.

## gigasecond

Expand Down Expand Up @@ -395,7 +395,7 @@ Added the missing `name` property and `reset()` method with type hints. The inst

## robot-simulator

Added typing to `Robot.__init__()`, as it is unclear what the parameter types should be. Added import for `Tuple` type hint.
Added typing to `Robot.__init__()`, as it is unclear what the parameter types should be. Added import for `Tuple` type hint. Added `Robot.move()`, `Robot.direction`, and `Robot.coordinates` since they are needed by the tests.

## roman-numerals

Expand Down
3 changes: 3 additions & 0 deletions evaluator/datasets/polyglot_py/forth/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ raise ZeroDivisionError("divide by zero")

#an example when the operation is undefined.
raise ValueError("undefined operation")

# an example when the operation is not allowed.
raise ValueError('illegal operation')
```
4 changes: 2 additions & 2 deletions evaluator/datasets/polyglot_py/list-ops/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def map(function: Callable[[Any], Any], list: list) -> list:
pass


def foldl(function: Callable[[Any, Any], list], list: list, initial: Any) -> Any: # function(acc, el)
def foldl(function: Callable[[Any, Any], Any], list: list, initial: Any) -> Any: # function(acc, el)
pass


def foldr(function: Callable[[Any, Any], list], list: list, initial: Any) -> Any: # function(acc, el)
def foldr(function: Callable[[Any, Any], Any], list: list, initial: Any) -> Any: # function(acc, el)
pass


Expand Down
11 changes: 11 additions & 0 deletions evaluator/datasets/polyglot_py/robot-simulator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,14 @@
class Robot:
def __init__(self, direction: int = NORTH, x_pos: int = 0, y_pos: int = 0) -> None:
pass

def move(self, commands: str) -> None:
pass

@property
def direction(self) -> int:
pass

@property
def coordinates(self) -> Tuple[int, int]:
pass