def _verify(function):
<EOL>def wrapped(pin, *args, **kwargs):<EOL><INDENT>pin = int(pin)<EOL>if pin not in _open:<EOL><INDENT>ppath = gpiopath(pin)<EOL>if not os.path.exists(ppath):<EOL><INDENT>log.debug("<STR_LIT>".format(pin))<EOL>with _export_lock:<EOL><INDENT>with open(pjoin(gpio_root, '<STR_LIT>'), '<STR_LIT:w>') as f:<EOL><INDENT>_write(f, pin)<EOL><DEDENT><DEDENT><DEDENT>value = open(pjoin(ppath, '<STR_LIT:value>'), FMODE)<EOL>direction = open(pjoin(ppath, '<STR_LIT>'), FMODE)<EOL>_open[pin] = PinState(value=value, direction=direction)<EOL><DEDENT>return function(pin, *args, **kwargs)<EOL><DEDENT>return wrapped<EOL>
decorator to ensure pin is properly set up