input: from typing import List
  
  
  def port_java_to_python(java_code: str) -> str:
      """ Converts the given Java code snippet to Python 3 code.
      >>> port_java_to_python(\"\"\"public class Foo {
      ...   public int foo( int a, int b ) {
      ...     return a + b;
      ...   }
      ... }\"\"\")
      'def foo(a, b):\\n return a + b'
      """
      return "def foo(a, b):\n return a + b"
output:     import re
  
      java_code = java_code.strip()
      java_code = re.sub(r'public\s+class\s+(\w+)\s*\{', '', java_code)
      java_code = re.sub(r'public\s+(\w+)\s+(\w+)\s*\(\s*(\w+)\s+(\w+)\s*,\s*(\w+)\s+(\w+)\s*\)\s*\{', r'def \2(\3, \5):\n', java_code)
      java_code = re.sub(r'return\s+(\w+)\s*;\s*\}', r' return \1', java_code)
      java_code = re.sub(r'\s*\}\s*$', '', java_code)
      return java_code