parameters: (nums)
return_statement: return res
docstring: 最大子数组
docstring_summary: 最大子数组
docstring_tokens: 最大子数组
function: def max_subarray(nums):
      """ 最大子数组 """
      if all(map(lambda x:x<0, nums)):
          return max(nums)
      res, tmp = 0, 0
      for i in nums:
          tmp += i
          res = max(res, tmp)
          if tmp < 0:
              tmp = 0
      return res
function_tokens: def max_subarray ( nums ) : if all ( map ( lambda x : x < 0 , nums ) ) : return max ( nums ) res , tmp = 0 , 0 for i in nums : tmp += i res = max ( res , tmp ) if tmp < 0 : tmp = 0 return res