def _isCheckpointDir(checkpointDir):
lastSegment = os.path.split(checkpointDir)[<NUM_LIT:1>]<EOL>if lastSegment[<NUM_LIT:0>] == '<STR_LIT:.>':<EOL><INDENT>return False<EOL><DEDENT>if not checkpointDir.endswith(g_defaultCheckpointExtension):<EOL><INDENT>return False<EOL><DEDENT>if not os.path.isdir(checkpointDir):<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Return true iff checkpointDir appears to be a checkpoint directory.