code: def check_imports(self):
          
          modules = []
          for filename in sorted(os.listdir(self.app_path)):
              if not filename.endswith('.py'):
                  continue
  
              fq_path = os.path.join(self.app_path, filename)
              with open(fq_path, 'rb') as f:
                  # TODO: fix this
                  code_lines = deque([(f.read(), 1)])
  
                  while code_lines:
                      m_status = True
                      code, lineno = code_lines.popleft()  # pylint: disable=W0612
                      try:
                          parsed_code = ast.parse(code)
                          for node in ast.walk(parsed_code):
                              if isinstance(node, ast.Import):
                                  for n in node.names:
                                      m = n.name.split('.')[0]
                                      if self.check_import_stdlib(m):
                                          # stdlib module, not need to proceed
                                          continue
                                      m_status = self.check_imported(m)
                                      modules.append(
                                          {'file': filename, 'module': m, 'status': m_status}
                                      )
                              elif isinstance(node, ast.ImportFrom):
                                  m = node.module.split('.')[0]
                                  if self.check_import_stdlib(m):
                                      # stdlib module, not need to proceed
                                      continue
                                  m_status = self.check_imported(m)
                                  modules.append({'file': filename, 'module': m, 'status': m_status})
                              else:
                                  continue
                      except SyntaxError:
                          pass
  
          for module_data in modules:
              status = True
              if not module_data.get('status'):
                  status = False
                  # update validation data errors
                  self.validation_data['errors'].append(
                      'Module validation failed for {} (module "{}" could not be imported).'.format(
                          module_data.get('file'), module_data.get('module')
                      )
                  )
              # update validation data for module
              self.validation_data['moduleImports'].append(
                  {
                      'filename': module_data.get('file'),
                      'module': module_data.get('module'),
                      'status': status,
                  }
              )
docs: Check the projects top level directory for missing imports.
  
          This method will check only files ending in **.py** and does not handle imports validation
          for sub-directories.