Repository: wandb/wandb

Issue:
Deprecation warnings due to invalid escape sequences in Python 3.8
Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals. pyupgrade also helps in automatic conversion : https://github.com/asottile/pyupgrade/ . Some of it is due to vendored libraries which needs an upgrade.

```
find . -iname '*.py' -not -path "wandb/vendor/*" | xargs -P4 -I{} python3 -Wall -m py_compile {}
./tests/utils/mock_server.py:645: DeprecationWarning: invalid escape sequence \ 
  return """
./wandb/sdk_py27/wandb_artifacts.py:40: DeprecationWarning: invalid escape sequence \-
  if not re.match("^[a-zA-Z0-9_\-.]+$", name):
./wandb/sdk/wandb_artifacts.py:40: DeprecationWarning: invalid escape sequence \-
  if not re.match("^[a-zA-Z0-9_\-.]+$", name):
./wandb/vendor/pygments/formatters/img.py:214: DeprecationWarning: invalid escape sequence \*
  """
./wandb/vendor/pygments/lexers/lisp.py:142: DeprecationWarning: invalid escape sequence \(
  ("(?<=\()(%s)" % '|'.join(re.escape(entry) + ' ' for entry in builtins),
./wandb/vendor/pygments/lexers/lisp.py:324: DeprecationWarning: invalid escape sequence \s
  (r'#+nil' + terminated + '\s*\(', Comment.Preproc, 'commented-form'),
./wandb/vendor/pygments/lexers/lisp.py:336: DeprecationWarning: invalid escape sequence \*
  (r'\*' + symbol + '\*', Name.Variable.Global),
./wandb/vendor/pygments/lexers/lisp.py:2157: DeprecationWarning: invalid escape sequence \*
  (r'\*' + symbol + '\*', Name.Variable.Global),
./wandb/vendor/pygments/lexers/javascript.py:538: DeprecationWarning: invalid escape sequence \s
  if re.search('^(import.+(from\s+)?["\']|'
./wandb/vendor/pygments/lexers/javascript.py:539: DeprecationWarning: invalid escape sequence \s
  '(export\s*)?(interface|class|function)\s+)',
./wandb/vendor/pygments/lexers/javascript.py:1018: DeprecationWarning: invalid escape sequence \s
  if re.search('^\s*@import\s+[<"]', text, re.MULTILINE):
./wandb/vendor/pygments/lexers/php.py:176: DeprecationWarning: invalid escape sequence \}
  (r'\$\{\$+' + _ident_inner + '\}', Name.Variable),
./wandb/vendor/pygments/lexers/php.py:217: DeprecationWarning: invalid escape sequence \[
  (r'\$' + _ident_inner + '(\[\S+?\]|->' + _ident_inner + ')?',
./wandb/vendor/pygments/lexers/haxe.py:46: DeprecationWarning: invalid escape sequence \$
  ident = r'(?:_*[a-z]\w*|_+[0-9]\w*|' + typeid + '|_+|\$\w+)'
./wandb/vendor/pygments/lexers/haxe.py:185: DeprecationWarning: invalid escape sequence \.
  (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float),
./wandb/vendor/pygments/lexers/haxe.py:222: DeprecationWarning: invalid escape sequence \.
  (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float, ('#pop', 'preproc-expr-chain')),
./wandb/vendor/pygments/lexers/haxe.py:459: DeprecationWarning: invalid escape sequence \.
  (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float, ('#pop', 'expr-chain')),
./wandb/vendor/pygments/lexers/haxe.py:714: DeprecationWarning: invalid escape sequence \.
  (r'[0-9]+\.(?!' + ident + '|\.\.)', Number.Float, '#pop'),
./wandb/vendor/pygments/lexers/configs.py:589: DeprecationWarning: invalid escape sequence \$
  ('\$\{', String.Interpol, 'var_builtin'),
./wandb/vendor/pygments/lexers/webmisc.py:441: DeprecationWarning: invalid escape sequence \(
  (r'(' + qname + ')(\()?', bygroups(Name, Punctuation), 'operator'),
./wandb/vendor/pygments/lexers/webmisc.py:646: DeprecationWarning: invalid escape sequence \*
  (ncname + ':\*', Name, 'operator'),
./wandb/vendor/pygments/lexers/webmisc.py:647: DeprecationWarning: invalid escape sequence \*
  ('\*:'+ncname, Name.Tag, 'operator'),
./wandb/vendor/pygments/lexers/webmisc.py:648: DeprecationWarning: invalid escape sequence \*
  ('\*', Name.Tag, 'operator'),
./wandb/vendor/pygments/lexers/webmisc.py:864: DeprecationWarning: invalid escape sequence \`
  """
./wandb/vendor/pygments/lexers/templates.py:190: DeprecationWarning: invalid escape sequence \{
  if re.search('\{if\s+.*?\}.*?\{/if\}', text):
./wandb/vendor/pygments/lexers/templates.py:192: DeprecationWarning: invalid escape sequence \{
  if re.search('\{include\s+file=.*?\}', text):
./wandb/vendor/pygments/lexers/templates.py:194: DeprecationWarning: invalid escape sequence \{
  if re.search('\{foreach\s+.*?\}.*?\{/foreach\}', text):
./wandb/vendor/pygments/lexers/templates.py:196: DeprecationWarning: invalid escape sequence \{
  if re.search('\{\$.*?\}', text):
./wandb/vendor/pygments/lexers/templates.py:945: DeprecationWarning: invalid escape sequence \$
  if re.search('\$\{.*?\}', text) is not None:
./wandb/vendor/pygments/lexers/templates.py:970: DeprecationWarning: invalid escape sequence \$
  if re.search('\$\{.*?\}', text) is not None:
./wandb/vendor/pygments/lexers/templates.py:1630: DeprecationWarning: invalid escape sequence \w
  if re.search('val \w+\s*:', text):
./wandb/vendor/pygments/lexers/templates.py:1958: DeprecationWarning: invalid escape sequence \}
  ('\}\}', Punctuation, '#pop'),  # end of output
./wandb/vendor/pygments/lexers/parsers.py:367: DeprecationWarning: invalid escape sequence \s
  (r'(scope)(\s*)(' + _id + ')(\s*)(\{)',
./wandb/vendor/pygments/lexers/parsers.py:373: DeprecationWarning: invalid escape sequence \s
  (r'(@' + _id + ')(\s*)(::)?(\s*)(' + _id + ')(\s*)(\{)',
./wandb/vendor/pygments/lexers/parsers.py:373: DeprecationWarning: invalid escape sequence \s
  (r'(@' + _id + ')(\s*)(::)?(\s*)(' + _id + ')(\s*)(\{)',
./wandb/vendor/pygments/lexers/parsers.py:408: DeprecationWarning: invalid escape sequence \s
  (r'(scope)(\s+)(' + _id + ')(\s*)(;)',
./wandb/vendor/pygments/lexers/parsers.py:411: DeprecationWarning: invalid escape sequence \s
  (r'(@' + _id + ')(\s*)(\{)',
./wandb/vendor/pygments/lexers/parsers.py:445: DeprecationWarning: invalid escape sequence \s
  + ')?(\s*)(;)',
./wandb/vendor/pygments/lexers/parsers.py:455: DeprecationWarning: invalid escape sequence \*
  '|'.join((_id, _STRING_LITERAL, _INT, '\*')) + ')(\s*)(;)',
./wandb/vendor/pygments/lexers/parsers.py:455: DeprecationWarning: invalid escape sequence \s
  '|'.join((_id, _STRING_LITERAL, _INT, '\*')) + ')(\s*)(;)',
./wandb/vendor/pygments/lexers/dsls.py:69: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_][\w.]*', Name),
./wandb/vendor/pygments/lexers/dsls.py:303: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Attribute),
./wandb/vendor/pygments/lexers/graphics.py:236: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*:(?!:)', Name.Label),
./wandb/vendor/pygments/lexers/graphics.py:237: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/graphics.py:337: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z_]\w*)(\s*)(=)',
./wandb/vendor/pygments/lexers/graphics.py:339: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z_]\w*)(\s*\(.*?\)\s*)(=)',
./wandb/vendor/pygments/lexers/graphics.py:385: DeprecationWarning: invalid escape sequence \[
  ('[{}()\[\]]', Punctuation),
./wandb/vendor/pygments/lexers/iolang.py:52: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/asm.py:38: DeprecationWarning: invalid escape sequence \.
  identifier = r'(?:[a-zA-Z$_]' + char + '*|\.' + char + '+)'
./wandb/vendor/pygments/lexers/asm.py:259: DeprecationWarning: invalid escape sequence \d
  ('\d+', Number.Integer),
./wandb/vendor/pygments/lexers/asm.py:353: DeprecationWarning: invalid escape sequence \s
  (identifier + '\s*:', Name.Label),
./wandb/vendor/pygments/lexers/robotframework.py:164: DeprecationWarning: invalid escape sequence \|
  _pipe_splitter = re.compile('((?:^| +)\|(?: +|$))')
./wandb/vendor/pygments/lexers/sql.py:158: DeprecationWarning: invalid escape sequence \s
  (r'(' + '|'.join(s.replace(" ", "\s+")
./wandb/vendor/pygments/lexers/j.py:55: DeprecationWarning: invalid escape sequence \.
  (words(('for_', 'goto_', 'label_'), suffix=validName+'\.'), Name.Label),
./wandb/vendor/pygments/lexers/j.py:61: DeprecationWarning: invalid escape sequence \.
  ), suffix='\.'), Name.Label),
./wandb/vendor/pygments/lexers/jvm.py:260: DeprecationWarning: invalid escape sequence \d
  letter_letter_digit = u'%s(?:%s|\d)*' % (letter, letter)
./wandb/vendor/pygments/lexers/jvm.py:692: DeprecationWarning: invalid escape sequence \w
  u'(?![\w!:?])', Name.Function),
./wandb/vendor/pygments/lexers/idl.py:56: DeprecationWarning: invalid escape sequence \w
  'catch', 'cd', 'cdf_\w*', 'ceil', 'chebyshev',
./wandb/vendor/pygments/lexers/idl.py:90: DeprecationWarning: invalid escape sequence \w
  'eof', 'eos_\w*', 'erase', 'erf', 'erfc', 'erfcx',
./wandb/vendor/pygments/lexers/idl.py:107: DeprecationWarning: invalid escape sequence \w
  'greg2jul', 'grib_\w*', 'grid3', 'griddata',
./wandb/vendor/pygments/lexers/idl.py:109: DeprecationWarning: invalid escape sequence \w
  'h5[adfgirst]_\w*', 'h5_browser', 'h5_close',
./wandb/vendor/pygments/lexers/idl.py:111: DeprecationWarning: invalid escape sequence \w
  'hanning', 'hash', 'hdf_\w*', 'heap_free',
./wandb/vendor/pygments/lexers/idl.py:159: DeprecationWarning: invalid escape sequence \w
  'ncdf_\w*', 'newton', 'noise_hurl', 'noise_pick',
./wandb/vendor/pygments/lexers/jvm.py:1261: DeprecationWarning: invalid escape sequence \w
  ('`?[a-zA-Z_][\w$]*', Name),
./wandb/vendor/pygments/lexers/clean.py:206: DeprecationWarning: invalid escape sequence \s
  prefix='(?<=\s)', suffix='(?=\s)'), Keyword.Namespace),
./wandb/vendor/pygments/lexers/clean.py:206: DeprecationWarning: invalid escape sequence \s
  prefix='(?<=\s)', suffix='(?=\s)'), Keyword.Namespace),
./wandb/vendor/pygments/lexers/perl.py:211: DeprecationWarning: invalid escape sequence \s
  if re.search('(?:my|our)\s+[$@%(]', text):
./wandb/vendor/pygments/lexers/perl.py:229: DeprecationWarning: invalid escape sequence \w
  PERL6_IDENTIFIER_RANGE = "['\w:-]"
./wandb/vendor/pygments/lexers/perl.py:498: DeprecationWarning: invalid escape sequence \s
  (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?',
./wandb/vendor/pygments/lexers/perl.py:594: DeprecationWarning: invalid escape sequence \s
  if re.search("(?:my|our|has)\s+(?:" + Perl6Lexer.PERL6_IDENTIFIER_RANGE +
./wandb/vendor/pygments/lexers/perl.py:595: DeprecationWarning: invalid escape sequence \s
  "+\s+)?[$@%&(]", text):
./wandb/vendor/pygments/lexers/perl.py:601: DeprecationWarning: invalid escape sequence \s
  if re.match('^\s*$', line):
./wandb/vendor/pygments/lexers/perl.py:605: DeprecationWarning: invalid escape sequence \s
  if re.match('^\s*(?:use\s+)?v6(?:\.\d(?:\.\d)?)?;', line):
./wandb/vendor/pygments/lexers/perl.py:608: DeprecationWarning: invalid escape sequence \s
  class_decl = re.match('^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
./wandb/vendor/pygments/lexers/_php_builtins.py:4691: DeprecationWarning: invalid escape sequence \.
  PHP_FUNCTION_RE    = '<a href="function\..*?\.html">(.*?)</a>'
./wandb/vendor/pygments/lexers/ml.py:46: DeprecationWarning: invalid escape sequence \|
  ':', '\|', '=', '=>', '->', '#',
./wandb/vendor/pygments/lexers/textfmts.py:269: DeprecationWarning: invalid escape sequence \S
  ('\S+', IncompleteTaskText, 'incomplete'),
./wandb/vendor/pygments/lexers/textfmts.py:280: DeprecationWarning: invalid escape sequence \S
  ('\S+', CompleteTaskText),
./wandb/vendor/pygments/lexers/textfmts.py:282: DeprecationWarning: invalid escape sequence \s
  ('\s+', CompleteTaskText),
./wandb/vendor/pygments/lexers/textfmts.py:293: DeprecationWarning: invalid escape sequence \S
  ('\S+', IncompleteTaskText),
./wandb/vendor/pygments/lexers/textfmts.py:295: DeprecationWarning: invalid escape sequence \s
  ('\s+', IncompleteTaskText),
./wandb/vendor/pygments/lexers/inferno.py:67: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/erlang.py:347: DeprecationWarning: invalid escape sequence \w
  alnum = '\w'
./wandb/vendor/pygments/lexers/erlang.py:498: DeprecationWarning: invalid escape sequence \.
  _prompt_re = re.compile('(iex|\.{3})(\(\d+\))?> ')
./wandb/vendor/pygments/lexers/ruby.py:406: DeprecationWarning: invalid escape sequence \(
  _prompt_re = re.compile('irb\([a-zA-Z_]\w*\):\d{3}:\d+[>*"\'] '
./wandb/vendor/pygments/lexers/ruby.py:407: DeprecationWarning: invalid escape sequence \?
  '|>> |\?> ')
./wandb/vendor/pygments/lexers/ruby.py:501: DeprecationWarning: invalid escape sequence \w
  ('[A-Z]\w*', Name.Constant),
./wandb/vendor/pygments/lexers/ruby.py:502: DeprecationWarning: invalid escape sequence \w
  ('@[a-zA-Z_]\w*', Name.Variable.Instance),
./wandb/vendor/pygments/lexers/ruby.py:503: DeprecationWarning: invalid escape sequence \w
  ('@@[a-zA-Z_]\w*', Name.Variable.Class),
./wandb/vendor/pygments/lexers/ruby.py:505: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/haskell.py:683: DeprecationWarning: invalid escape sequence \w
  boundary = '(?![\w/])'
./wandb/vendor/pygments/lexers/apl.py:74: DeprecationWarning: invalid escape sequence \.
  (u'¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)'
./wandb/vendor/pygments/lexers/apl.py:75: DeprecationWarning: invalid escape sequence \.
  u'([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?',
./wandb/vendor/pygments/lexers/apl.py:80: DeprecationWarning: invalid escape sequence \.
  (u'[\.\\\/⌿⍀¨⍣⍨⍠⍤∘]', Name.Attribute),  # closest token type
./wandb/vendor/pygments/lexers/apl.py:81: DeprecationWarning: invalid escape sequence \-
  (u'[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]',
./wandb/vendor/pygments/lexers/scripting.py:107: DeprecationWarning: invalid escape sequence \(
  ('\(', Punctuation, '#pop'),
./wandb/vendor/pygments/lexers/scripting.py:699: DeprecationWarning: invalid escape sequence \(
  ('\(\*', Comment.Multiline, '#push'),
./wandb/vendor/pygments/lexers/scripting.py:700: DeprecationWarning: invalid escape sequence \*
  ('\*\)', Comment.Multiline, '#pop'),
./wandb/vendor/pygments/lexers/csound.py:156: DeprecationWarning: invalid escape sequence \d
  if re.match('p\d+$', name) or name in OPCODES:
./wandb/vendor/pygments/lexers/rdf.py:114: DeprecationWarning: invalid escape sequence \:
  (r'(' + PN_PREFIX + ')?(\:)(' + PN_LOCAL + ')?',
./wandb/vendor/pygments/lexers/rdf.py:128: DeprecationWarning: invalid escape sequence \.
  (r'[+\-]?(\d+\.\d*' + EXPONENT + '|\.?\d+' + EXPONENT + ')', Number.Float),
./wandb/vendor/pygments/lexers/actionscript.py:128: DeprecationWarning: invalid escape sequence \.
  typeidentifier = identifier + '(?:\.<\w+>)?'
./wandb/vendor/pygments/lexers/actionscript.py:235: DeprecationWarning: invalid escape sequence \s
  ('\s+', Text),
./wandb/vendor/pygments/lexers/dylan.py:185: DeprecationWarning: invalid escape sequence \*
  (r'\*' + valid_name + '\*', Name.Variable.Global),
./wandb/vendor/pygments/lexers/dylan.py:263: DeprecationWarning: invalid escape sequence \?
  _prompt_re = re.compile('\?| ')
./wandb/vendor/pygments/lexers/testing.py:32: DeprecationWarning: invalid escape sequence \*
  step_keywords = u'^(\\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y\'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )'
./wandb/vendor/pygments/lexers/bibtex.py:104: DeprecationWarning: invalid escape sequence \{
  ('[^\{\"]+', String),
./wandb/vendor/pygments/lexers/bibtex.py:109: DeprecationWarning: invalid escape sequence \{
  ('[^\{\}]+', String),
./wandb/vendor/pygments/lexers/bibtex.py:157: DeprecationWarning: invalid escape sequence \s
  ('\s+', Text),
./wandb/vendor/pygments/lexers/objective.py:90: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)',
./wandb/vendor/pygments/lexers/objective.py:93: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?',
./wandb/vendor/pygments/lexers/objective.py:96: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)',
./wandb/vendor/pygments/lexers/objective.py:99: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))',
./wandb/vendor/pygments/lexers/objective.py:102: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*)(\{)',
./wandb/vendor/pygments/lexers/objective.py:104: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop')
./wandb/vendor/pygments/lexers/objective.py:107: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*,\s*)',
./wandb/vendor/pygments/lexers/objective.py:109: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*;?)',
./wandb/vendor/pygments/lexers/objective.py:247: DeprecationWarning: invalid escape sequence \s
  ('\s+', Text),
./wandb/vendor/pygments/lexers/objective.py:249: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)',
./wandb/vendor/pygments/lexers/objective.py:251: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)', Name.Class),
./wandb/vendor/pygments/lexers/objective.py:252: DeprecationWarning: invalid escape sequence \)
  ('\)', Punctuation, '#pop'),
./wandb/vendor/pygments/lexers/objective.py:255: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?',
./wandb/vendor/pygments/lexers/objective.py:257: DeprecationWarning: invalid escape sequence \w
  ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop')
./wandb/vendor/pygments/lexers/c_like.py:248: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/c_like.py:347: DeprecationWarning: invalid escape sequence \$
  ('\$\**\&?\w+', Name),
./wandb/vendor/pygments/lexers/rebol.py:105: DeprecationWarning: invalid escape sequence \+
  elif re.match('(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$',
./wandb/vendor/pygments/lexers/rebol.py:108: DeprecationWarning: invalid escape sequence \?
  elif re.match(".*\?$", word):
./wandb/vendor/pygments/lexers/rebol.py:110: DeprecationWarning: invalid escape sequence \!
  elif re.match(".*\!$", word):
./wandb/vendor/pygments/lexers/rebol.py:300: DeprecationWarning: invalid escape sequence \+
  elif re.match('(\+|-\*\*|-|\*\*|//|/|\*|and|or|xor|=\?|===|==|=|<>|<=|>=|'
./wandb/vendor/pygments/lexers/rebol.py:303: DeprecationWarning: invalid escape sequence \!
  elif re.match(".*\!$", word):
./wandb/vendor/pygments/lexers/varnish.py:39: DeprecationWarning: invalid escape sequence \.
  elif '\nvcl 4\.0;' in text[:1000]:
./wandb/vendor/pygments/lexers/varnish.py:123: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/python.py:183: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/python.py:187: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Function, '#pop'),
./wandb/vendor/pygments/lexers/python.py:191: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Class, '#pop')
./wandb/vendor/pygments/lexers/python.py:268: DeprecationWarning: invalid escape sequence \w
  '((\w+)((\.\w+)|(\[[^\]]+\]))*)?'  # field name
./wandb/vendor/pygments/lexers/python.py:269: DeprecationWarning: invalid escape sequence \!
  '(\![sra])?'                       # conversion
./wandb/vendor/pygments/lexers/python.py:270: DeprecationWarning: invalid escape sequence \:
  '(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?'
./wandb/vendor/pygments/lexers/python.py:271: DeprecationWarning: invalid escape sequence \}
  '\}', String.Interpol),
./wandb/vendor/pygments/lexers/python.py:674: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/python.py:677: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Function, '#pop')
./wandb/vendor/pygments/lexers/python.py:694: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Class, '#pop')
./wandb/vendor/pygments/lexers/html.py:223: DeprecationWarning: invalid escape sequence \s
  ('\s+', Text),
./wandb/vendor/pygments/lexers/html.py:316: DeprecationWarning: invalid escape sequence \]
  (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
./wandb/vendor/pygments/lexers/html.py:333: DeprecationWarning: invalid escape sequence \}
  (r'\{(,\n|' + _dot + ')*?\}', using(RubyLexer)),
./wandb/vendor/pygments/lexers/html.py:334: DeprecationWarning: invalid escape sequence \]
  (r'\[' + _dot + '*?\]', using(RubyLexer)),
./wandb/vendor/pygments/lexers/html.py:343: DeprecationWarning: invalid escape sequence \}
  (r'(#\{)(' + _dot + '*?)(\})',
./wandb/vendor/pygments/lexers/html.py:376: DeprecationWarning: invalid escape sequence \}
  (r'(#\{)(' + _dot + '*?)(\})',
./wandb/vendor/pygments/lexers/html.py:425: DeprecationWarning: invalid escape sequence \]
  (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
./wandb/vendor/pygments/lexers/html.py:445: DeprecationWarning: invalid escape sequence \}
  (r'\{(,\n|' + _dot + ')*?\}', using(ScalaLexer)),
./wandb/vendor/pygments/lexers/html.py:446: DeprecationWarning: invalid escape sequence \]
  (r'\[' + _dot + '*?\]', using(ScalaLexer)),
./wandb/vendor/pygments/lexers/html.py:455: DeprecationWarning: invalid escape sequence \}
  (r'(#\{)(' + _dot + '*?)(\})',
./wandb/vendor/pygments/lexers/html.py:488: DeprecationWarning: invalid escape sequence \}
  (r'(#\{)(' + _dot + '*?)(\})',
./wandb/vendor/pygments/lexers/html.py:533: DeprecationWarning: invalid escape sequence \]
  (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
./wandb/vendor/pygments/lexers/html.py:554: DeprecationWarning: invalid escape sequence \}
  (r'\{(,\n|' + _dot + ')*?\}', using(ScalaLexer)),
./wandb/vendor/pygments/lexers/html.py:555: DeprecationWarning: invalid escape sequence \]
  (r'\[' + _dot + '*?\]', using(ScalaLexer)),
./wandb/vendor/pygments/lexers/html.py:564: DeprecationWarning: invalid escape sequence \}
  (r'(#\{)(' + _dot + '*?)(\})',
./wandb/vendor/pygments/lexers/html.py:597: DeprecationWarning: invalid escape sequence \}
  (r'(#\{)(' + _dot + '*?)(\})',
./wandb/vendor/pygments/lexers/_cocoa_builtins.py:44: DeprecationWarning: invalid escape sequence \w
  res = re.findall('(?<=@interface )\w+', content)
./wandb/vendor/pygments/lexers/_cocoa_builtins.py:48: DeprecationWarning: invalid escape sequence \w
  res = re.findall('(?<=@protocol )\w+', content)
./wandb/vendor/pygments/lexers/_cocoa_builtins.py:52: DeprecationWarning: invalid escape sequence \w
  res = re.findall('(?<=typedef enum )\w+', content)
./wandb/vendor/pygments/lexers/_cocoa_builtins.py:56: DeprecationWarning: invalid escape sequence \w
  res = re.findall('(?<=typedef struct )\w+', content)
./wandb/vendor/pygments/lexers/_cocoa_builtins.py:60: DeprecationWarning: invalid escape sequence \w
  res = re.findall('(?<=typedef const struct )\w+', content)
./wandb/vendor/pygments/lexers/prolog.py:60: DeprecationWarning: invalid escape sequence \w
  u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
./wandb/vendor/pygments/lexers/prolog.py:64: DeprecationWarning: invalid escape sequence \w
  u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
./wandb/vendor/pygments/lexers/prolog.py:68: DeprecationWarning: invalid escape sequence \w
  u'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*',
./wandb/vendor/pygments/lexers/prolog.py:303: DeprecationWarning: invalid escape sequence \s
  elif re.search('^:-\s[a-z]', text, re.M):
./wandb/vendor/pygments/lexers/julia.py:149: DeprecationWarning: invalid escape sequence \=
  u'\=', u'.\=', u'^=', u'.^=', u'÷=', u'.÷=', u'%=', u'.%=', u'|=', u'&=',
./wandb/vendor/pygments/lexers/julia.py:149: DeprecationWarning: invalid escape sequence \=
  u'\=', u'.\=', u'^=', u'.^=', u'÷=', u'.÷=', u'%=', u'.%=', u'|=', u'&=',
./wandb/vendor/pygments/lexers/matlab.py:137: DeprecationWarning: invalid escape sequence \s
  if re.match('^\s*%', text, re.M):  # comment
./wandb/vendor/pygments/lexers/matlab.py:139: DeprecationWarning: invalid escape sequence \w
  elif re.match('^!\w+', text, re.M):  # system cmd
./wandb/vendor/pygments/lexers/pawn.py:39: DeprecationWarning: invalid escape sequence \s
  ('^#if\s+0', Comment.Preproc, 'if0'),
./wandb/vendor/pygments/lexers/pawn.py:65: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/pawn.py:151: DeprecationWarning: invalid escape sequence \s
  ('^#if\s+0', Comment.Preproc, 'if0'),
./wandb/vendor/pygments/lexers/pawn.py:177: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/grammar_notation.py:161: DeprecationWarning: invalid escape sequence \A
  ('\A#JSGF[^;]*', Comment.Preproc),
./wandb/vendor/pygments/lexers/c_cpp.py:39: DeprecationWarning: invalid escape sequence \s
  ('^#if\s+0', Comment.Preproc, 'if0'),
./wandb/vendor/pygments/lexers/c_cpp.py:87: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/c_cpp.py:193: DeprecationWarning: invalid escape sequence \s
  if re.search('^\s*#include [<"]', text, re.MULTILINE):
./wandb/vendor/pygments/lexers/c_cpp.py:195: DeprecationWarning: invalid escape sequence \s
  if re.search('^\s*#ifn?def ', text, re.MULTILINE):
./wandb/vendor/pygments/lexers/qvt.py:144: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name),
./wandb/vendor/pygments/lexers/dotnet.py:61: DeprecationWarning: invalid escape sequence \w
  'none': '@?[_a-zA-Z]\w*',
./wandb/vendor/pygments/lexers/dotnet.py:174: DeprecationWarning: invalid escape sequence \w
  'none': '@?[_a-zA-Z]\w*',
./wandb/vendor/pygments/lexers/dotnet.py:355: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Function, '#pop')
./wandb/vendor/pygments/lexers/dotnet.py:358: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_]\w*', Name.Class, '#pop')
./wandb/vendor/pygments/lexers/dotnet.py:361: DeprecationWarning: invalid escape sequence \w
  ('[a-zA-Z_][\w.]*', Name.Namespace, '#pop')
./wandb/vendor/pygments/lexers/dotnet.py:416: DeprecationWarning: invalid escape sequence \.
  prefix='(?<!\.)', suffix=r'\b'), Keyword),
./wandb/vendor/pygments/lexers/dotnet.py:577: DeprecationWarning: invalid escape sequence \(
  '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.',
./wandb/vendor/pygments/lexers/dotnet.py:577: DeprecationWarning: invalid escape sequence \)
  '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.',
./wandb/vendor/pygments/lexers/dotnet.py:577: DeprecationWarning: invalid escape sequence \*
  '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.',
./wandb/vendor/pygments/lexers/dotnet.py:577: DeprecationWarning: invalid escape sequence \+
  '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.',
./wandb/vendor/pygments/lexers/dotnet.py:577: DeprecationWarning: invalid escape sequence \.
  '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.',
./wandb/vendor/pygments/lexers/dotnet.py:578: DeprecationWarning: invalid escape sequence \.
  '->', '-', '\.\.', '\.', '::', ':=', ':>', ':', ';;', ';', '<-',
./wandb/vendor/pygments/lexers/dotnet.py:578: DeprecationWarning: invalid escape sequence \.
  '->', '-', '\.\.', '\.', '::', ':=', ':>', ':', ';;', ';', '<-',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \]
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \]
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \?
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \?
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \[
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \[
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \[
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:579: DeprecationWarning: invalid escape sequence \]
  '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]',
./wandb/vendor/pygments/lexers/dotnet.py:580: DeprecationWarning: invalid escape sequence \{
  '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>',
./wandb/vendor/pygments/lexers/dotnet.py:580: DeprecationWarning: invalid escape sequence \|
  '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>',
./wandb/vendor/pygments/lexers/dotnet.py:580: DeprecationWarning: invalid escape sequence \|
  '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>',
./wandb/vendor/pygments/lexers/dotnet.py:580: DeprecationWarning: invalid escape sequence \}
  '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>',
./wandb/vendor/pygments/lexers/pascal.py:596: DeprecationWarning: invalid escape sequence \w
  ('"[^"]+"|[\w.]+', Name.Function),
./wandb/vendor/pygments/lexers/pascal.py:597: DeprecationWarning: invalid escape sequence \s
  ('\s+', Text),
./wandb/vendor/pygments/lexers/pascal.py:631: DeprecationWarning: invalid escape sequence \s
  ('is\s+new|renames', Keyword.Reserved),
./wandb/vendor/pygments/lexers/pascal.py:634: DeprecationWarning: invalid escape sequence \(
  ('\(', Punctuation, 'package_instantiation'),
./wandb/vendor/pygments/lexers/pascal.py:635: DeprecationWarning: invalid escape sequence \w
  ('([\w.]+)', Name.Class),
./wandb/vendor/graphql-core-1.1/graphql/language/lexer.py:226: DeprecationWarning: invalid escape sequence \.
  """Reads a number token from the source file, either a float
./wandb/sweeps/config/cfg.py:58: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  kwargs = {k:v for k, v in kwargs.items() if v is not None and k is not "self"}
```


Discussion:

Resolving patch:
diff --git a/wandb/sdk/wandb_artifacts.py b/wandb/sdk/wandb_artifacts.py
--- a/wandb/sdk/wandb_artifacts.py
+++ b/wandb/sdk/wandb_artifacts.py
@@ -37,7 +37,7 @@ class Artifact(object):
     """An artifact object you can write files into, and pass to log_artifact."""
 
     def __init__(self, name, type, description=None, metadata=None):
-        if not re.match("^[a-zA-Z0-9_\-.]+$", name):
+        if not re.match(r"^[a-zA-Z0-9_\-.]+$", name):
             raise ValueError(
                 'Artifact name may only contain alphanumeric characters, dashes, underscores, and dots. Invalid name: "%s"'
                 % name
diff --git a/wandb/sdk_py27/wandb_artifacts.py b/wandb/sdk_py27/wandb_artifacts.py
--- a/wandb/sdk_py27/wandb_artifacts.py
+++ b/wandb/sdk_py27/wandb_artifacts.py
@@ -37,7 +37,7 @@ class Artifact(object):
     """An artifact object you can write files into, and pass to log_artifact."""
 
     def __init__(self, name, type, description=None, metadata=None):
-        if not re.match("^[a-zA-Z0-9_\-.]+$", name):
+        if not re.match(r"^[a-zA-Z0-9_\-.]+$", name):
             raise ValueError(
                 'Artifact name may only contain alphanumeric characters, dashes, underscores, and dots. Invalid name: "%s"'
                 % name
diff --git a/wandb/sweeps/config/cfg.py b/wandb/sweeps/config/cfg.py
--- a/wandb/sweeps/config/cfg.py
+++ b/wandb/sweeps/config/cfg.py
@@ -55,7 +55,7 @@ def __init__(self, module=None, version=None):
             self._version_dict.setdefault(module, version)
 
     def _config(self, base, args, kwargs, root=False):
-        kwargs = {k:v for k, v in kwargs.items() if v is not None and k is not "self"}
+        kwargs = {k:v for k, v in kwargs.items() if v is not None and k != "self"}
         # remove kwargs if empty
         if kwargs.get("kwargs") == {}:
             del kwargs["kwargs"]


Test patch:
diff --git a/tests/utils/mock_server.py b/tests/utils/mock_server.py
--- a/tests/utils/mock_server.py
+++ b/tests/utils/mock_server.py
@@ -642,7 +642,7 @@ def storage():
         elif file == "diff.patch":
             # TODO: make sure the patch is valid for windows as well,
             # and un skip the test in test_cli.py
-            return """
+            return r"""
 diff --git a/patch.txt b/patch.txt
 index 30d74d2..9a2c773 100644
 --- a/patch.txt