def __guess_dataset_by_filename(filename):
 try:
  fields = os.path.split(filename)
  if fields:
   if (fields[(-1)].startswith('dataset_') and fields[(-1)].endswith('.dat')):
    return Dataset.get(int(fields[(-1)][len('dataset_'):(- len('.dat'))]))
 except:
  pass
 return None

def __guess_dataset_by_filename ( filename ) : try : fields = os . path . split ( filename ) if fields : if ( fields [ ( - 1 ) ] . startswith ( 'dataset_' ) and fields [ ( - 1 ) ] . endswith ( '.dat' ) ) : return Dataset . get ( int ( fields [ ( - 1 ) ] [ len ( 'dataset_' ) : ( - len ( '.dat' ) ) ] ) ) except : pass return None
return a guessed dataset by filename .