code: def interpolate_exe(self, testString):
          
          # First check if any interpolation is needed and abort if not
          testString = testString.strip()
          if not (testString.startswith('${') and testString.endswith('}')):
              return testString
  
          # This may not be an exe interpolation, so even if it has ${XXX} form
          # I may not have to do anything
          newString = testString
  
          # Strip the ${ and }
          testString = testString[2:-1]
  
          testList = testString.split(':')
  
          # Maybe we can add a few different possibilities for substitution
          if len(testList) == 2:
              if testList[0] == 'which':
                  newString = distutils.spawn.find_executable(testList[1])
                  if not newString:
                      errmsg = "Cannot find exe %s in your path " %(testList[1])
                      errmsg += "and you specified ${which:%s}." %(testList[1])
                      raise ValueError(errmsg)
  
          return newString
docs: Replace testString with a path to an executable based on the format.
  
          If this looks like
  
          ${which:lalapps_tmpltbank}
  
          it will return the equivalent of which(lalapps_tmpltbank)
  
          Otherwise it will return an unchanged string.
  
          Parameters
          -----------
          testString : string
              The input string
  
          Returns
          --------
          newString : string
              The output string.