<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_structure(tlobjects, output_dir):
 """ Pre-create the required directory structure in `output_dir` for the input objects. """

    types_ns = set()
    method_ns = set()
    for obj in tlobjects:
        if obj.namespace:
            if obj.is_function:
                method_ns.add(obj.namespace)
            else:
                types_ns.add(obj.namespace)

    output_dir.mkdir(exist_ok=True)

    type_dir = output_dir / 'types'
    type_dir.mkdir(exist_ok=True)

    cons_dir = output_dir / 'constructors'
    cons_dir.mkdir(exist_ok=True)
    for ns in types_ns:
        (type_dir / ns).mkdir(exist_ok=True)
        (cons_dir / ns).mkdir(exist_ok=True)

    meth_dir = output_dir / 'methods'
    meth_dir.mkdir(exist_ok=True)
    for ns in types_ns:
        (meth_dir / ns).mkdir(exist_ok=True)