def process_memory_command(matchobj): """Function to process match of ``memory ...``.""" spaces = str(matchobj.group(1)) sig = str(matchobj.group(2)) units = str(matchobj.group(3)) mem_in_bytes = set_memory(sig + units, execute=False) return "%score.set_memory_bytes(%d)\n" % (spaces, mem_in_bytes)