import re
from fileanalyzer import FileAnalyzer


class PythonAnalyzer(FileAnalyzer):

    def get_class_count(self, content):
        return len(
            re.findall("class [a-zA-Z0-9_]+\(?[a-zA-Z0-9_, ]*\)?:", content))

    def get_function_count(self, content):
        return len(
            re.findall("def [a-zA-Z0-9_]+\([a-zA-Z0-9_, ]*\):", content))

import re
from fileanalyzer import FileAnalyzer


class PythonAnalyzer(FileAnalyzer):

    def get_class_count(self, content):
        return len(
            re.findall("class +[a-zA-Z0-9_]+ *\(?[a-zA-Z0-9_, ]*\)? *:", content))

    def get_function_count(self, content):
        return len(
            re.findall("def +[a-zA-Z0-9_]+ *\([a-zA-Z0-9_, ]*\) *:", content))

Update regex to allow spaces
Update regex to allow spaces

  import re
  from fileanalyzer import FileAnalyzer
  
  
  class PythonAnalyzer(FileAnalyzer):
  
      def get_class_count(self, content):
          return len(
-             re.findall("class [a-zA-Z0-9_]+\(?[a-zA-Z0-9_, ]*\)?:", content))
+             re.findall("class +[a-zA-Z0-9_]+ *\(?[a-zA-Z0-9_, ]*\)? *:", content))
  
      def get_function_count(self, content):
          return len(
-             re.findall("def [a-zA-Z0-9_]+\([a-zA-Z0-9_, ]*\):", content))
+             re.findall("def +[a-zA-Z0-9_]+ *\([a-zA-Z0-9_, ]*\) *:", content))
  
Update regex to allow spaces
## Code Before:
import re
from fileanalyzer import FileAnalyzer


class PythonAnalyzer(FileAnalyzer):

    def get_class_count(self, content):
        return len(
            re.findall("class [a-zA-Z0-9_]+\(?[a-zA-Z0-9_, ]*\)?:", content))

    def get_function_count(self, content):
        return len(
            re.findall("def [a-zA-Z0-9_]+\([a-zA-Z0-9_, ]*\):", content))

## Instruction:
Update regex to allow spaces
## Code After:
import re
from fileanalyzer import FileAnalyzer


class PythonAnalyzer(FileAnalyzer):

    def get_class_count(self, content):
        return len(
            re.findall("class +[a-zA-Z0-9_]+ *\(?[a-zA-Z0-9_, ]*\)? *:", content))

    def get_function_count(self, content):
        return len(
            re.findall("def +[a-zA-Z0-9_]+ *\([a-zA-Z0-9_, ]*\) *:", content))
