parameters: (self, nums)
return_statement: return -1
docstring: :type nums: List[int]
          :rtype: int
docstring_summary: :type nums: List[int]
          :rtype: int
docstring_tokens: : type nums : List [ int ] : rtype : int
function: def pivotIndex(self, nums):
          """
          :type nums: List[int]
          :rtype: int
          """
          total = sum(nums)
          left_sum = 0
          for i, num in enumerate(nums):
              if left_sum == (total-left_sum-num):
                  return i
              left_sum += num
          return -1
function_tokens: def pivotIndex ( self , nums ) : total = sum ( nums ) left_sum = 0 for i , num in enumerate ( nums ) : if left_sum == ( total - left_sum - num ) : return i left_sum += num return - 1