@_verify<EOL>def setup(pin, mode, pullup=None, initial=False):
if pullup is not None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if mode not in (IN, OUT, LOW, HIGH):<EOL><INDENT>raise ValueError(mode)<EOL><DEDENT>log.debug("<STR_LIT>".format(pin, mode))<EOL>f = _open[pin].direction<EOL>_write(f, mode)<EOL>if mode == OUT:<EOL><INDENT>if initial:<EOL><INDENT>set(pin, <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>set(pin, <NUM_LIT:0>)<EOL><DEDENT><DEDENT>
Setup pin with mode IN or OUT.

    Args:
        pin (int):
        mode (str): use either gpio.OUT or gpio.IN
        pullup (None): rpio compatibility. If anything but None, raises
            value Error
        pullup (bool, optional): Initial pin value. Default is False