input: from typing import List
  
  def calculate_depth_of_parentheses(paren_string: str) -> List[int]:
      """ This function takes a string that contains several groups of nested parentheses separated by spaces.
      It returns the deepest level of nesting for each group of parentheses.
      For example, (()()) has a depth of two, whereas ((())) has a depth of three.
  
      >>> calculate_depth_of_parentheses('(()()) ((())) () ((())()())')
      [2, 3, 1, 3]
      """
output:     depths = []
      groups = paren_string.split()
  
      for group in groups:
          max_depth = 0
          current_depth = 0
          for char in group:
              if char == '(':
                  current_depth += 1
                  max_depth = max(max_depth, current_depth)
              elif char == ')':
                  current_depth -= 1
          depths.append(max_depth)
  
      return depths