parameters: (direc=os.path.curdir, ext=None, orig=1)
docstring: Replace Numeric/arrayobject.h with numpy/oldnumeric.h in all files in the
      directory with extension give by list ext (if ext is None, then all files are
      replaced).
docstring_summary: Replace Numeric/arrayobject.h with numpy/oldnumeric.h in all files in the
      directory with extension give by list ext (if ext is None, then all files are
      replaced).
docstring_tokens: Replace Numeric / arrayobject . h with numpy / oldnumeric . h in all files in the directory with extension give by list ext ( if ext is None then all files are replaced ) .
function: def convertsrc(direc=os.path.curdir, ext=None, orig=1):
      """Replace Numeric/arrayobject.h with numpy/oldnumeric.h in all files in the
      directory with extension give by list ext (if ext is None, then all files are
      replaced)."""
      if ext is None:
          files = glob.glob(os.path.join(direc,'*'))
      else:
          files = []
          for aext in ext:
              files.extend(glob.glob(os.path.join(direc,"*.%s" % aext)))
      for afile in files:
          fid = open(afile)
          fstr = fid.read()
          fid.close()
          fstr, n = header_re.subn(r'numpy/oldnumeric.h',fstr)
          if n > 0:
              if orig:
                  base, ext = os.path.splitext(afile)
                  os.rename(afile, base+".orig")
              else:
                  os.remove(afile)
              makenewfile(afile, fstr)
function_tokens: def convertsrc ( direc = os . path . curdir , ext = None , orig = 1 ) : if ext is None : files = glob . glob ( os . path . join ( direc , '*' ) ) else : files = [ ] for aext in ext : files . extend ( glob . glob ( os . path . join ( direc , "*.%s" % aext ) ) ) for afile in files : fid = open ( afile ) fstr = fid . read ( ) fid . close ( ) fstr , n = header_re . subn ( r'numpy/oldnumeric.h' , fstr ) if n > 0 : if orig : base , ext = os . path . splitext ( afile ) os . rename ( afile , base + ".orig" ) else : os . remove ( afile ) makenewfile ( afile , fstr )