def run_game_converter(cmd_line_args=None):
	import argparse
	import sys

	parser = argparse.ArgumentParser(
		description='Prepare SGF Go game files for training the neural network model.',
		epilog="Available features are: board, ones, turns_since, liberties,\
		capture_size, self_atari_size, liberties_after, sensibleness, and zeros.\
		Ladder features are not currently implemented")
	parser.add_argument("--features", "-f", help="Comma-separated list of features to compute and store or 'all'", default='all')
	parser.add_argument("--outfile", "-o", help="Destination to write data (hdf5 file)", required=True)
	parser.add_argument("--recurse", "-R", help="Set to recurse through directories searching for SGF files", default=False, action="store_true")
	parser.add_argument("--directory", "-d", help="Directory containing SGF files to process. if not present, expects files from stdin", default=None)
	parser.add_argument("--size", "-s", help="Size of the game board. SGFs not matching this are discarded with a warning", type=int, default=19)
	parser.add_argument("--verbose", "-v", help="Turn on verbose mode", default=False, action="store_true")

	if cmd_line_args is None:
		args = parser.parse_args()
	else:
		args = parser.parse_args(cmd_line_args)

	if args.features.lower() == 'all':
		feature_list = [
			"board",
			"ones",
			"turns_since",
			"liberties",
			"capture_size",
			"self_atari_size",
			"liberties_after",
			# "ladder_capture",
			# "ladder_escape",
			"sensibleness",
			"zeros"]
	else:
		feature_list = args.features.split(",")

	if args.verbose:
		print "using features", feature_list

	converter = game_converter(feature_list)

	def _is_sgf(fname):
		return fname.strip()[-4:] == ".sgf"

	def _walk_all_sgfs(root):
		"""a helper function/generator to get all SGF files in subdirectories of root
		"""
		for (dirpath, dirname, files) in os.walk(root):
			for filename in files:
				if _is_sgf(filename):
					# yield the full (relative) path to the file
					yield os.path.join(dirpath, filename)

	def _list_sgfs(path):
		"""helper function to get all SGF files in a directory (does not recurse)
		"""
		files = os.listdir(path)
		return (os.path.join(path, f) for f in files if _is_sgf(f))

	# get an iterator of SGF files according to command line args
	if args.directory:
		if args.recurse:
			files = _walk_all_sgfs(args.directory)
		else:
			files = _list_sgfs(args.directory)
	else:
		files = (f.strip() for f in sys.stdin if _is_sgf(f))

	converter.sgfs_to_hdf5(files, args.outfile, bd_size=args.size, verbose=args.verbose)
If a pulp registry is specified, use the pulp plugin
dataset/ETHPy150Open Rochester-NRT/RocAlphaGo/AlphaGo/preprocessing/game_converter.py/run_game_converter--crossover with--dataset/ETHPy150Open projectatomic/osbs-client/osbs/build/build_request.py/ProductionBuild.render_pulp_sync