<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mkdir(path):
 """Make a directory and its parents. Args: path (str):
 path to create Returns: None Raises: OSError if the directory cannot be created. """

    try:
        os.makedirs(path)
        # sanity check
        if not os.path.isdir(path):  # pragma: no cover
            raise IOError('path is not a directory')
    except OSError as e:
        # EEXIST
        if e.errno == 17 and os.path.isdir(path):
            return
        raise