<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def move_examples(root, lib_dir):
 """find examples not under lib dir, and move into ``examples``"""

    all_pde = files_multi_pattern(root, INO_PATTERNS)
    lib_pde = files_multi_pattern(lib_dir, INO_PATTERNS)
    stray_pde = all_pde.difference(lib_pde)
    if len(stray_pde) and not len(lib_pde):
        log.debug(
            'examples found outside lib dir, moving them: %s', stray_pde)
        examples = lib_dir / EXAMPLES
        examples.makedirs()
        for x in stray_pde:
            d = examples / x.namebase
            d.makedirs()
            x.move(d)