def verify_format_docstrings():
 format_infractions = []
 for path in list_files('.py'):
  rel_path = os.path.relpath(path, pylearn2.__path__[0])
  if (rel_path in whitelist_docstrings):
   continue
  try:
   format_infractions.extend(docstring_errors(path))
  except Exception as e:
   format_infractions.append([('%s failed to run so format cannot be checked. Error message:\n %s' % (rel_path, e))])
 if (len(format_infractions) > 0):
  msg = '\n'.join((':'.join(line) for line in format_infractions))
  raise AssertionError(('Docstring format not respected:\n%s' % msg))

def verify_format_docstrings ( ) : format_infractions = [ ] for path in list_files ( '.py' ) : rel_path = os . path . relpath ( path , pylearn2 . __path__ [ 0 ] ) if ( rel_path in whitelist_docstrings ) : continue try : format_infractions . extend ( docstring_errors ( path ) ) except Exception as e : format_infractions . append ( [ ( '%s failed to run so format cannot be checked. Error message:\n %s' % ( rel_path , e ) ) ] ) if ( len ( format_infractions ) > 0 ) : msg = '\n' . join ( ( ':' . join ( line ) for line in format_infractions ) ) raise AssertionError ( ( 'Docstring format not respected:\n%s' % msg ) )
implementation of test_format_docstrings .