def _translate_glob(pat):
translated_parts = []<EOL>for part in _iexplode_path(pat):<EOL><INDENT>translated_parts.append(_translate_glob_part(part))<EOL><DEDENT>os_sep_class = '<STR_LIT>' % re.escape(SEPARATORS)<EOL>res = _join_translated(translated_parts, os_sep_class)<EOL>return '<STR_LIT>'.format(res=res)<EOL>
Translate a glob PATTERN to a regular expression.