old_contents: #!/usr/bin/env python
  """Fortran to Python Interface Generator.
  
  """
  from __future__ import division, absolute_import, print_function
  
  __all__ = ['run_main', 'compile', 'f2py_testing']
  
  import sys
  
  from . import f2py2e
  from . import f2py_testing
  from . import diagnose
  
  run_main = f2py2e.run_main
  main = f2py2e.main
  
  
  def compile(source,
              modulename='untitled',
              extra_args='',
              verbose=1,
              source_fn=None
              ):
      ''' Build extension module from processing source with f2py.
      Read the source of this function for more information.
      '''
      from numpy.distutils.exec_command import exec_command
      import tempfile
      if source_fn is None:
          f = tempfile.NamedTemporaryFile(suffix='.f')
      else:
          f = open(source_fn, 'w')
  
      try:
          f.write(source)
          f.flush()
  
          args = ' -c -m %s %s %s' % (modulename, f.name, extra_args)
          c = '%s -c "import numpy.f2py as f2py2e;f2py2e.main()" %s' % \
              (sys.executable, args)
          s, o = exec_command(c)
      finally:
          f.close()
      return s
  
  from numpy.testing import Tester
  test = Tester().test
  bench = Tester().bench
  
new_contents: #!/usr/bin/env python
  """Fortran to Python Interface Generator.
  
  """
  from __future__ import division, absolute_import, print_function
  
  __all__ = ['run_main', 'compile', 'f2py_testing']
  
  import sys
  
  from . import f2py2e
  from . import f2py_testing
  from . import diagnose
  
  run_main = f2py2e.run_main
  main = f2py2e.main
  
  
  def compile(source,
              modulename='untitled',
              extra_args='',
              verbose=True,
              source_fn=None,
              extension='.f'
              ):
      ''' Build extension module from processing source with f2py.
  
      Parameters
      ----------
      source : str
          Fortran source of module / subroutine to compile
      modulename : str, optional
          the name of compiled python module
      extra_args: str, optional
          additional parameters passed to f2py
      verbose: bool, optional
          print f2py output to screen
      extension: {'.f', '.f90'}, optional
          filename extension influences the fortran compiler behavior
  
      '''
      from numpy.distutils.exec_command import exec_command
      import tempfile
      if source_fn is None:
          f = tempfile.NamedTemporaryFile(suffix=extension)
      else:
          f = open(source_fn, 'w')
  
      try:
          f.write(source)
          f.flush()
  
          args = ' -c -m {} {} {}'.format(modulename, f.name, extra_args)
          c = '{} -c "import numpy.f2py as f2py2e;f2py2e.main()" {}'
          c = c.format(sys.executable, args)
          status, output = exec_command(c)
          if verbose:
              print(output)
      finally:
          f.close()
      return status
  
  from numpy.testing import Tester
  test = Tester().test
  bench = Tester().bench
  
subject: Add extension parameter to f2py.compile and fix verbose.