from simple.types import IO cases = ([IO([0, 1], -1)], \ [IO([0, 0], 0)], [IO([0, 0], 0), IO([1, -1], 2)], [IO([10**100, 10**100], 0)], [IO([10**100, 10**250], 10**100 - 10**250)], )
from simple.types import IO cases = ( [IO(('outsystems.com', ), 10)], [IO(('outsystems.com', '.'), 10)], [IO(('outsystems.com', ), 10), IO(('cmu.edu', ), 3)], # Adding more '.' shouldn't confuse the synthesizer. [IO(('outsystems.com', ), 10), IO(('abc.gmail.com', ), 3)], )
from simple.types import IO cases = ( # 0: Size 2 [IO(('John', 'Doe'), 'John Doe')], # 1: Size 2 [ IO(('John', 'Doe'), 'John Doe'), IO(('Anne', 'Smith'), 'Anne Smith'), ], # 2: Size 3 [ IO(('John', 'Doe', '-Odoi'), 'John Doe-Odoi'), ], # 3: Size 3 [ IO(('John', 'Doe', '-Odoi'), 'John Doe-Odoi'), IO(('Anne', 'Smith', '-Sonian'), 'Anne Smith-Sonian'), ], # 4: Size 3, learning the prefix [ IO(('John', 'Doe'), 'Dr. John Doe'), ], # 5: Size 3, learning the prefix [ IO(('John', 'Doe'), 'Dr. John Doe'),
from simple.types import IO cases = ([IO([0, 1], 1)], \ [IO([0, 0], 0)], [IO([0, 0], 0), IO([-1, 1], 0)], [IO([-10**100, 10**100], 0)], [IO([10**100, 10**250], 10**100 + 10**250)], )
from simple.types import IO cases = ( [ IO(('Text longer than thirty characters.', ), 'Text longer than thirty charac') ], [ IO(('Text longer than thirty characters.', ), 'Text longer than thirty charac'), IO(('Small text.', ), 'Small text.') ], [ IO(('Text longer than thirty characters.', ), 'Text longer than thirty charac'), IO(('Small text.', ), 'Small text.'), IO(('This text is also longer than thirty characters.', ), 'This text is also longer than ') ], [IO(('01/04/2000', ), '01')], [IO(('01/04/2000', ), '01'), IO(('02/05/2000', ), '02')], [IO(('01/04/2000', ), '04')], [IO(('01/04/2000', ), '04'), IO(('02/05/2000', ), '05')], [IO(('01/04/2000', ), '2000')], [IO(('01/04/2000', ), '2000'), IO(('02/05/2001', ), '2001')], [IO(('#01-04-2000#', ), '2000')], [IO(('#01-04-2000#', ), '2000'), IO(('#02-05-2001#', ), '2001')],
from simple.types import IO cases = ( # 00 [IO(('outsystems.com', ), 'outsystems')], # 01 [IO(('outsystems.com', ), 'outsystems'), IO(('cmu.edu', ), 'cmu')], # 02 [ IO(('outsystems.com', ), 'outsystems'), IO(('cmu.edu', ), 'cmu'), IO(('tecnico.pt', ), 'tecnico') ], # 03 [IO(('outsystems.com', '.'), 'outsystems'), IO(('cmu.edu', '.'), 'cmu')], # 04 [ IO(('www.outsystems.com', ), 'outsystems'), IO(('www.cmu.edu', ), 'cmu'), IO(('www.tecnico.pt', ), 'tecnico') ], # 05 [ IO(('www.outsystems.com', ), 'outsystems'), IO(('www.cmu.edu', ), 'cmu'), IO(('www3.tecnico.pt', ), 'tecnico') ], # 06 [
from simple.types import IO cases = ( [ IO(('Text longer than thirty characters.', ), 'Text longer than thirty charac...') ], [ IO(('Text longer than thirty characters.', ), 'Text longer than thirty charac...'), IO(('Small text.', ), 'Small text.') ], [ IO(('Text longer than thirty characters.', ), 'Text longer than thirty charac...'), IO(('Small text.', ), 'Small text.'), IO(('This text is also longer than thirty characters.', ), 'This text is also longer than ...') ], )
from simple.types import IO cases = ( [IO(('abc', ), 3)], [IO(('abc', ), 3), IO(('rodrigo', ), 7)], [IO(('abc', ), 3), IO(('rodrigo', ), 7), IO(('pedro', ), 5)], )
from simple.types import IO cases = ( [IO([' abc '], 'abc')], [IO([' abc'], 'abc')], [IO(['abc '], 'abc')], [IO(['\tabc\t \n'], 'abc')], [IO([' a b c '], 'a b c')], )
from simple.types import IO cases = ([IO(['abc'], 'abc')], \ [IO(['ABC'], 'abc')], [IO(['aBc'], 'abc')], [IO(['aBC'], 'abc')], [IO(['a B C'], 'a b c')], )
from simple.types import IO # NewLine takes no inputs. cases = ([IO([], '\n')], \ )
def read_one_example(ex: Dict[str, Dict[str, str]]) -> IO: inputs = tuple(read_value(val) for val in ex["inputs"]) output = read_value(ex["output"]) return IO(inputs, output)
from simple.types import IO cases = ( \ [IO(['abc'], 'ABC')], \ [IO(['ABC'], 'ABC')], [IO(['aBc'], 'ABC')], [IO(['aBC'], 'ABC')], [IO(['a B C'], 'A B C')], )