input: def port_java_to_python(java_code: str) -> str:
      """Ports a given Java code snippet to Python 3. The input Java code is a public class with a single method that takes two integer parameters and returns their sum.
      The output Python code should be a function with the same logic.
      >>> port_java_to_python("public class Foo { public int foo( int a, int b ) { return a + b; } }")
      "def foo(a, b): return a + b"
      """
output:     import re
  
      # Remove Java class declaration and method signature
      java_code = re.sub(r'public class \w+ \{', '', java_code)
      java_code = re.sub(r'public int \w+\( int (\w+), int (\w+) \) \{', r'def foo(\1, \2):', java_code)
  
      # Replace Java return statement with Python return statement
      python_code = re.sub(r'return (\w+) \+ (\w+);', r'return \1 + \2', java_code)
  
      # Remove trailing Java closing brace
      python_code = python_code.rstrip(' }')
  
      return python_code