def getAllFilesIn(dir, tag='', extension='.pickle'):
 allfiles = os.listdir(dir)
 res = []
 for f in allfiles:
  if ((f[(- len(extension)):] == extension) and (f[:len(tag)] == tag)):
   res.append(f[:(- len(extension))])
 return res

def getAllFilesIn ( dir , tag = '' , extension = '.pickle' ) : allfiles = os . listdir ( dir ) res = [ ] for f in allfiles : if ( ( f [ ( - len ( extension ) ) : ] == extension ) and ( f [ : len ( tag ) ] == tag ) ) : res . append ( f [ : ( - len ( extension ) ) ] ) return res
return a list of all filenames in the specified directory .