def show(a, b, /, c=0, *, label='default'):
    print(a, b, c, label)
arguments = (1, 'two')
show(*arguments, **{'c': 3, 'label': 'expanded'})
show(*[4, 'five'], *(6,), label='mixed')
alias = show
alias(*(7, 'eight'), **{'label': 'alias'})

def collect(*args, **kwargs):
    print(args, kwargs)
collect(*(1, 'a'), *[True, 2], **{'third': 3, 'first': 1}, second=2)
collect(**{'a': 1, 'b': 2, 'a': 3})
collect(**{'a': 1}, **{'b': 2})

def mark(label, value):
    print(label)
    return value
show(c=mark('keyword', 9), *mark('star', (1, 'two')))
collect(**{'a': mark('first a', 1), 'b': mark('b', 2), 'a': mark('last a', 3)})

def factory(offset):
    return lambda value, *, extra=0: offset + value + extra
print(factory(10)(*(2,), **{'extra': 3}))

class Counter:
    def __init__(self, value, *, step=1):
        self.value = value
        self.step = step
    def add(self, amount=1):
        return self.value + amount * self.step
counter = Counter(*(10,), **{'step': 2})
print(counter.add(*(3,)))
saved = counter.add
print(saved(**{'amount': 4}))
print(Counter.add(*(counter, 5)))
print(max(*(1, 7, 3)), sorted(*([3, 1, 2],), **{'reverse': True}))

collect(*(), *[], **{})
def factorial(n):
    if n == 0:
        return 1
    return n * factorial(*(n - 1,))
print(factorial(*(5,)))

def choose():
    print('callee')
    return show
choose()(*mark('positional', (8, 'nine')), **{'label': mark('named', 'chosen')})

def fail():
    raise ValueError('argument failed')
    return 0
try:
    show(*[mark('before failure', 1), fail()], **{'label': mark('not reached', 'later')})
except ValueError as error:
    print(error)
