parameters: (validFilesSet, outputFolder, fileType)
return_statement: return badFrameDict
docstring: Out of the files of a given type, find the ones that are not in
      the given set of valid images.
docstring_summary: Out of the files of a given type, find the ones that are not in
      the given set of valid images.
docstring_tokens: Out of the files of a given type find the ones that are not in the given set of valid images .
function: def findInvalidFrames(validFilesSet, outputFolder, fileType):
      '''Out of the files of a given type, find the ones that are not in
      the given set of valid images.'''
  
      if fileType   == 'ortho':
          dataFolder = getOrthoFolder(outputFolder)
      elif fileType == 'jpeg':
          dataFolder = getJpegFolder(outputFolder)
      else:
          raise Exception("Unknown file type: " + fileType)
  
      # To be able to study which files are in which set, make all paths consistenty
      # absolute
      localOutputFolder = os.path.basename(outputFolder)
      localFileSet = set()
      for fileName in validFilesSet:
          fileName = os.path.abspath(fileName)
  
          # Correct for wrong path to folder (fragile)
          #m = re.match("^.*?" + localOutputFolder + "/(.*?)$", fileName)
          #if not m: continue
          #fileName = os.path.abspath(os.path.join(outputFolder, m.group(1)))
          localFileSet.add(fileName)
  
      indexPath = csvIndexFile(dataFolder)
      if not os.path.exists(indexPath):
          raise Exception("Missing file: " + indexPath)
      (frameDict, urlDict) = readIndexFile(indexPath, prependFolder = True)
      badFrameDict = {}
  
      for frame in frameDict.keys():
          fileName = os.path.abspath(frameDict[frame])
  
          # Correct for wrong path to folder (fragile)
          #m = re.match("^.*?" + localOutputFolder + "/(.*?)$", fileName)
          #if not m: continue
          #fileName = os.path.abspath(os.path.join(outputFolder, m.group(1)))
          if fileName not in localFileSet:
              badFrameDict[frame] = fileName
      
      return badFrameDict
function_tokens: def findInvalidFrames ( validFilesSet , outputFolder , fileType ) : if fileType == 'ortho' : dataFolder = getOrthoFolder ( outputFolder ) elif fileType == 'jpeg' : dataFolder = getJpegFolder ( outputFolder ) else : raise Exception ( "Unknown file type: " + fileType ) # To be able to study which files are in which set, make all paths consistenty # absolute localOutputFolder = os . path . basename ( outputFolder ) localFileSet = set ( ) for fileName in validFilesSet : fileName = os . path . abspath ( fileName ) # Correct for wrong path to folder (fragile) #m = re.match("^.*?" + localOutputFolder + "/(.*?)$", fileName) #if not m: continue #fileName = os.path.abspath(os.path.join(outputFolder, m.group(1))) localFileSet . add ( fileName ) indexPath = csvIndexFile ( dataFolder ) if not os . path . exists ( indexPath ) : raise Exception ( "Missing file: " + indexPath ) ( frameDict , urlDict ) = readIndexFile ( indexPath , prependFolder = True ) badFrameDict = { } for frame in frameDict . keys ( ) : fileName = os . path . abspath ( frameDict [ frame ] ) # Correct for wrong path to folder (fragile) #m = re.match("^.*?" + localOutputFolder + "/(.*?)$", fileName) #if not m: continue #fileName = os.path.abspath(os.path.join(outputFolder, m.group(1))) if fileName not in localFileSet : badFrameDict [ frame ] = fileName return badFrameDict