<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _IOC(cls, dir, op, structure=None):
 """ Encode an ioctl id. """

        control = cls(dir, op, structure)

        def do(dev, **args):
            return control(dev, **args)
        return do