def find_base(path):
result = _pattern.match(path)<EOL>if result:<EOL><INDENT>base = result.group(<NUM_LIT:0>)<EOL><DEDENT>else:<EOL><INDENT>base = "<STR_LIT>"<EOL><DEDENT>if base.endswith('<STR_LIT:/>') or base.endswith('<STR_LIT:\\>'):<EOL><INDENT>return os.path.abspath(base)<EOL><DEDENT>else:<EOL><INDENT>return os.path.dirname(os.path.abspath(base))<EOL><DEDENT>
Find the base of a glob.