parameters: (pattern)
return_statement: return pattern[:0].join(s)
docstring: Escape all non-alphanumeric characters in pattern.
docstring_summary: Escape all non-alphanumeric characters in pattern.
docstring_tokens: Escape all non - alphanumeric characters in pattern .
function: def escape(pattern):
      "Escape all non-alphanumeric characters in pattern."
      s = list(pattern)
      alphanum = _alphanum
      for i, c in enumerate(pattern):
          if c not in alphanum:
              if c == "\000":
                  s[i] = "\\000"
              else:
                  s[i] = "\\" + c
      return pattern[:0].join(s)
function_tokens: def escape ( pattern ) : s = list ( pattern ) alphanum = _alphanum for i , c in enumerate ( pattern ) : if c not in alphanum : if c == "\000" : s [ i ] = "\\000" else : s [ i ] = "\\" + c return pattern [ : 0 ] . join ( s )