parameters: (self, nums1, nums2)
return_statement: return result
docstring: :type nums1: List[int]
          :type nums2: List[int]
          :rtype: int
docstring_summary: :type nums1: List[int]
          :type nums2: List[int]
          :rtype: int
docstring_tokens: : type nums1 : List [ int ] : type nums2 : List [ int ] : rtype : int
function: def numTriplets(self, nums1, nums2):
          """
          :type nums1: List[int]
          :type nums2: List[int]
          :rtype: int
          """
          def two_product(nums, i):
              count = 0
              lookup = collections.defaultdict(int)
              for num in nums:
                  if i%num:
                      continue
                  count += lookup[i//num]
                  lookup[num] += 1
              return count
          
          result = 0
          for num in nums1:
              result += two_product(nums2, num**2)
          for num in nums2:
              result += two_product(nums1, num**2)
          return result
function_tokens: def numTriplets ( self , nums1 , nums2 ) : def two_product ( nums , i ) : count = 0 lookup = collections . defaultdict ( int ) for num in nums : if i % num : continue count += lookup [ i // num ] lookup [ num ] += 1 return count result = 0 for num in nums1 : result += two_product ( nums2 , num ** 2 ) for num in nums2 : result += two_product ( nums1 , num ** 2 ) return result