def _glob_to_re(self, pattern):
pattern_re = fnmatch.translate(pattern)<EOL>sep = os.sep<EOL>if os.sep == '<STR_LIT:\\>':<EOL><INDENT>sep = r'<STR_LIT>'<EOL><DEDENT>escaped = r'<STR_LIT>' % sep<EOL>pattern_re = re.sub(r'<STR_LIT>', escaped, pattern_re)<EOL>return pattern_re<EOL>
Translate a shell-like glob pattern to a regular expression.

        Return a string containing the regex.  Differs from
        'fnmatch.translate()' in that '*' does not match "special characters"
        (which are platform-specific).