parameters: (self, s)
return_statement: return res
docstring: :type s: str
          :rtype: int
docstring_summary: :type s: str
          :rtype: int
docstring_tokens: : type s : str : rtype : int
function: def romanToInt(self, s):
          """
          :type s: str
          :rtype: int
          """
          s_dict = {'I':1, 'V':5, 'X':10, 'L':50, 'C':100, 'D':500, 'M':1000}
          res, pre = 0, 0
          for i in s:
              cur = s_dict[i]
              if pre < cur:
                  res += (cur - 2*pre)
              else:
                  res += cur
              pre = cur
          return res
function_tokens: def romanToInt ( self , s ) : s_dict = { 'I' : 1 , 'V' : 5 , 'X' : 10 , 'L' : 50 , 'C' : 100 , 'D' : 500 , 'M' : 1000 } res , pre = 0 , 0 for i in s : cur = s_dict [ i ] if pre < cur : res += ( cur - 2 * pre ) else : res += cur pre = cur return res