def get_sampler(sample_mode: str):
if sample_mode == '<STR_LIT:all>':<EOL><INDENT>return All<EOL><DEDENT>mode = sample_mode.split('<STR_LIT::>')<EOL>if mode[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>if len(mode) == <NUM_LIT:2>:<EOL><INDENT>return partial(UniformReservoir, size=int(mode[<NUM_LIT:1>]))<EOL><DEDENT>else:<EOL><INDENT>return UniformReservoir<EOL><DEDENT><DEDENT>raise TypeError(f'<STR_LIT>')<EOL>
Return a sampler constructor

    >>> get_sampler('all')
    <class 'cr8.metrics.All'>

    >>> get_sampler('reservoir')
    <class 'cr8.metrics.UniformReservoir'>

    >>> get_sampler('reservoir:100')
    functools.partial(<class 'cr8.metrics.UniformReservoir'>, size=100)