original_docstring: 
      print out the head files as well as cpp entry files to call the function
      
docstring: print out the head files as well as cpp entry files to call the function
docstring_tokens: print out the head files as well as cpp entry files to call the function
code: def filesCreation(workDir):
      """
      print out the head files as well as cpp entry files to call the function
      """
  
      # get the parent working dir
      fileDir = os.path.split(os.path.abspath(workDir))[0]
  
      # firstly, we need to search the whole folder to see that
      # whether we have localmemscr class used in the cpp files
      hasLocalMemScr = useLocalMemScrObject(workDir)
  
      # get the project name from the dir
      name = getProjectName(workDir)
      incfile = fileDir + "/" + name + ".h"
      head = open(incfile, "w")
  
      # top macros
      macro = name.upper()
      line = "#ifndef  " + macro + "_H"
      printCode(head, line)
      line = "#define " + macro + "_H"
      printCode(head, line)
      printEmptyLine(head)
  
      # head file, we have to make up the name
      line = "#include <cstddef>"
      printCode(head, line)
      line = "#include <cassert>"
      printCode(head, line)
      line = "#include <cstdio>"
      printCode(head, line)
      if hasLocalMemScr:
          line = "#include \"localmemscr.h\""
          printCode(head, line)
          line = "using namespace localmemscr;"
          printCode(head, line)
      printEmptyLine(head)
  
      # typedef information
      # only use it when we do not include localmemscr
      if not hasLocalMemScr:
          line = "typedef int             Int; "
          printCode(head, line)
          line = "typedef long long       LInt; "
          printCode(head, line)
          line = "typedef size_t          UInt; "
          printCode(head, line)
          line = "#ifdef WITH_SINGLE_PRECISION "
          printCode(head, line)
          line = "typedef float           Double;"
          printCode(head, line)
          line = "#else"
          printCode(head, line)
          line = "typedef double          Double;"
          printCode(head, line)
          line = "#endif"
          printCode(head, line)
      printEmptyLine(head)
  
      # before we create the entry file, firstly let's get
      # the entry function argument list
      # we note, that all of cpp functions share the same
      # function list, except that some of them may have
      # additional localmemscr objeect pass in
      # now let's do it
      entryFunArgList = " "
      cppfiles = os.listdir(workDir)
      for i in cppfiles:
  
          # we will omit the non-main cpp files
          if not isMainCPPFile(i):
              continue
  
          # read in the argument list from the cpp file
          workFile = workDir + "/" + i
          entryFunArgList = getArgumentList(workFile)
          break
  
      # set up the entry file - cpp file
      cppfile = fileDir + "/" + name + ".cpp"
      cpp = open(cppfile, "w")
  
      # include header file into cpp file
      inc = name + ".h"
      line = "#include " + "\"" + inc + "\""
      printCode(cpp, line)
      line = "#include " + "<cstdio>"
      printCode(cpp, line)
      line = "#include " + "<cassert>"
      printCode(cpp, line)
      printEmptyLine(cpp)
  
      # generating the function names
      # then we are done with this
      # we note, that for each of the function it may have the namespace
      # around it
      # you can choose what you want, modify here
      entryFunArgList = "const LInt& LCode, " + entryFunArgList
      if hasLocalMemScr:
          if re.search(r"(?i)LocalMemScr", entryFunArgList) is None:
              entryFunArgList = entryFunArgList + ", LocalMemScr& scr"
      returnType = "void "
      funcname = returnType + name + "(" + entryFunArgList + ")"
      printCode(cpp, funcname)
  
      # begin to print the body of entry cpp file
      line = "{"
      printCode(cpp, line)
      printEmptyLine(cpp)
  
      # step into the main body,waiting for the further printing
      line = "switch (LCode) {"
      printCode(cpp, line, 2)
  
      # now loop over the dir to get each file name
      cppfiles = os.listdir(workDir)
      for i in cppfiles:
  
          # we will omit the non-main cpp files
          if not isMainCPPFile(i):
              continue
  
          # read in the argument list from the cpp file
          workFile = workDir + "/" + i
          arglist = getArgumentList(workFile)
  
          # drop the extension
          # print it in the head file
          flist = os.path.splitext(i)
          fname = flist[0]
          line = returnType + fname + "(" + arglist + ");"
          printCode(head, line)
          printEmptyLine(head)
  
          # now print the entry cpp file
          # we get the LCode
          LCode = getLCode(fname)
          line = "case " + str(LCode) + ":"
          printCode(cpp, line, 4)
  
          # now it's function call
          funcArgList = getFuncArgumentList(arglist)
          line = fname + "(" + funcArgList + ");"
          printCode(cpp, line, 6)
          line = "break;"
          printCode(cpp, line, 6)
  
      # finish the head file printingg
      line = "#endif"
      printCode(head, line)
      head.close()
  
      # finish the switch code
      line = "default:"
      printCode(cpp, line, 4)
      line = "printf(\"%s %lld\\n\","
      line = line + "\"Un-recognized LCode in the integrals calculation \", "
      line = line + "LCode);"
      printCode(cpp, line, 6)
      line = "assert(0);"
      printCode(cpp, line, 6)
      line = "break;"
      printCode(cpp, line, 6)
      line = "}"
      printCode(cpp, line, 2)
      printEmptyLine(cpp)
  
      # finish the whole function code
      line = "}"
      printCode(cpp, line)
      cpp.close()
code_tokens: def filesCreation ( workDir ) : fileDir = os . path . split ( os . path . abspath ( workDir ) ) [ 0 ] hasLocalMemScr = useLocalMemScrObject ( workDir ) name = getProjectName ( workDir ) incfile = fileDir + "/" + name + ".h" head = open ( incfile , "w" ) macro = name . upper ( ) line = "#ifndef  " + macro + "_H" printCode ( head , line ) line = "#define " + macro + "_H" printCode ( head , line ) printEmptyLine ( head ) line = "#include <cstddef>" printCode ( head , line ) line = "#include <cassert>" printCode ( head , line ) line = "#include <cstdio>" printCode ( head , line ) if hasLocalMemScr : line = "#include \"localmemscr.h\"" printCode ( head , line ) line = "using namespace localmemscr;" printCode ( head , line ) printEmptyLine ( head ) if not hasLocalMemScr : line = "typedef int             Int; " printCode ( head , line ) line = "typedef long long       LInt; " printCode ( head , line ) line = "typedef size_t          UInt; " printCode ( head , line ) line = "#ifdef WITH_SINGLE_PRECISION " printCode ( head , line ) line = "typedef float           Double;" printCode ( head , line ) line = "#else" printCode ( head , line ) line = "typedef double          Double;" printCode ( head , line ) line = "#endif" printCode ( head , line ) printEmptyLine ( head ) entryFunArgList = " " cppfiles = os . listdir ( workDir ) for i in cppfiles : if not isMainCPPFile ( i ) : continue workFile = workDir + "/" + i entryFunArgList = getArgumentList ( workFile ) break cppfile = fileDir + "/" + name + ".cpp" cpp = open ( cppfile , "w" ) inc = name + ".h" line = "#include " + "\"" + inc + "\"" printCode ( cpp , line ) line = "#include " + "<cstdio>" printCode ( cpp , line ) line = "#include " + "<cassert>" printCode ( cpp , line ) printEmptyLine ( cpp ) entryFunArgList = "const LInt& LCode, " + entryFunArgList if hasLocalMemScr : if re . search ( r"(?i)LocalMemScr" , entryFunArgList ) is None : entryFunArgList = entryFunArgList + ", LocalMemScr& scr" returnType = "void " funcname = returnType + name + "(" + entryFunArgList + ")" printCode ( cpp , funcname ) line = "{" printCode ( cpp , line ) printEmptyLine ( cpp ) line = "switch (LCode) {" printCode ( cpp , line , 2 ) cppfiles = os . listdir ( workDir ) for i in cppfiles : if not isMainCPPFile ( i ) : continue workFile = workDir + "/" + i arglist = getArgumentList ( workFile ) flist = os . path . splitext ( i ) fname = flist [ 0 ] line = returnType + fname + "(" + arglist + ");" printCode ( head , line ) printEmptyLine ( head ) LCode = getLCode ( fname ) line = "case " + str ( LCode ) + ":" printCode ( cpp , line , 4 ) funcArgList = getFuncArgumentList ( arglist ) line = fname + "(" + funcArgList + ");" printCode ( cpp , line , 6 ) line = "break;" printCode ( cpp , line , 6 ) line = "#endif" printCode ( head , line ) head . close ( ) line = "default:" printCode ( cpp , line , 4 ) line = "printf(\"%s %lld\\n\"," line = line + "\"Un-recognized LCode in the integrals calculation \", " line = line + "LCode);" printCode ( cpp , line , 6 ) line = "assert(0);" printCode ( cpp , line , 6 ) line = "break;" printCode ( cpp , line , 6 ) line = "}" printCode ( cpp , line , 2 ) printEmptyLine ( cpp ) line = "}" printCode ( cpp , line ) cpp . close ( )
short_docstring: print out the head files as well as cpp entry files to call the function
short_docstring_tokens: print out the head files as well as cpp entry files to call the function
comment: """
      print out the head files as well as cpp entry files to call the function
      """$SEP$# get the parent working dir$SEP$# firstly, we need to search the whole folder to see that$SEP$# whether we have localmemscr class used in the cpp files$SEP$# get the project name from the dir$SEP$# top macros$SEP$# head file, we have to make up the name$SEP$# typedef information$SEP$# only use it when we do not include localmemscr$SEP$# before we create the entry file, firstly let's get$SEP$# the entry function argument list$SEP$# we note, that all of cpp functions share the same$SEP$# function list, except that some of them may have$SEP$# additional localmemscr objeect pass in$SEP$# now let's do it$SEP$# we will omit the non-main cpp files$SEP$# read in the argument list from the cpp file$SEP$# set up the entry file - cpp file$SEP$# include header file into cpp file$SEP$# generating the function names$SEP$# then we are done with this$SEP$# we note, that for each of the function it may have the namespace$SEP$# around it$SEP$# you can choose what you want, modify here$SEP$# begin to print the body of entry cpp file$SEP$# step into the main body,waiting for the further printing$SEP$# now loop over the dir to get each file name$SEP$# we will omit the non-main cpp files$SEP$# read in the argument list from the cpp file$SEP$# drop the extension$SEP$# print it in the head file$SEP$# now print the entry cpp file$SEP$# we get the LCode$SEP$# now it's function call$SEP$# finish the head file printingg$SEP$# finish the switch code$SEP$# finish the whole function code