input: from typing import List
  
  def sum_of_subsequence_powers(nums: List[int], k: int) -> int:
      """
      Given a list of integers nums with length n and a positive integer k, we need to calculate the following.
  
      The power of a subsequence is defined as the minimum absolute difference between any two elements in the subsequence.
  
      Compute the sum of powers of all subsequences of nums that have length k.
  
      Since the result may be large, return it modulo 10^9 + 7.
  
      Examples:
      >>> nums = [1,2,3,4], k = 3
      4
      >>> nums = [2,2], k = 2
      0
      >>> nums = [4,3,-1], k = 2
      10
  
      Constraints:
      2 <= n == nums.length <= 50
      -10^8 <= nums[i] <= 10^8 
      2 <= k <= n
      """
output:     
      from itertools import combinations
  
      MOD = 10**9 + 7
  
      def subsequence_power(subseq):
          return min(abs(a - b) for a, b in combinations(subseq, 2))
      
      n = len(nums)
      result = 0
  
      for comb in combinations(nums, k):
          result = (result + subsequence_power(comb)) % MOD
  
      return result
  