def _isCheckpointDir(checkpointDir):
 lastSegment = os.path.split(checkpointDir)[1]
 if (lastSegment[0] == '.'):
  return False
 if (not checkpointDir.endswith(g_defaultCheckpointExtension)):
  return False
 if (not os.path.isdir(checkpointDir)):
  return False
 return True

def _isCheckpointDir ( checkpointDir ) : lastSegment = os . path . split ( checkpointDir ) [ 1 ] if ( lastSegment [ 0 ] == '.' ) : return False if ( not checkpointDir . endswith ( g_defaultCheckpointExtension ) ) : return False if ( not os . path . isdir ( checkpointDir ) ) : return False return True
return true iff checkpointdir appears to be a checkpoint directory .