input: from typing import List
  
  def power_to_csharp(py_function: str) -> str:
      """ Converts a given Python function that calculates the power of a number to a C# function.
      >>> power_to_csharp('def power(x, y):\\n    if y == 0:\\n        return 1\\n    else:\\n        return x * power(x, y - 1)')
      'public int Power(int x, int y)\\n{\\n    if (y == 0)\\n    {\\n        return 1;\\n    }\\n    else\\n    {\\n        return x * Power(x, y - 1);\\n    }\\n}'
      """
output:     lines = py_function.split('\n')
      csharp_function = []
      csharp_function.append('public int Power(int x, int y)')
      csharp_function.append('{')
      
      for line in lines[1:]:
          if 'def' in line:
              continue
          line = line.replace('if', 'if (')
          line = line.replace('return', 'return ')
          line = line.replace(':', ')')
          line = line.replace('else:', 'else')
          line = line.replace('power', 'Power')
          line = line.replace('x * power', 'x * Power')
          line += ';'
          csharp_function.append('    ' + line)
      
      csharp_function.append('}')
      return '\n'.join(csharp_function)